Bug 171957

Summary: taglib corrupts ogg files when the tag data exceeds about 64 KB
Product: [Frameworks and Libraries] taglib Reporter: Marc Halbruegge <marc.halbruegge>
Component: generalAssignee: Scott Wheeler <wheeler>
Status: RESOLVED FIXED    
Severity: crash CC: lalinsky, rdieter, ruiz
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Attachments: new implementation of Ogg::Page::paginate
new implementation of Ogg::Page::paginate (fixed)
cumulative patch for several bugs

Description Marc Halbruegge 2008-10-01 13:23:06 UTC
Version:            (using Devel)
OS:                MS Windows
Installed from:    Compiled sources

Taglib is at the moment unable to split a packet into several ogg pages. 

When the size of the comment packet exceeds about 64KB (maximum size of an ogg page), the data is not written, resulting in an unplayable ogg file (method Ogg::Page::paginate in taglib/ogg/oggpage.cpp).
Comment 1 Marc Halbruegge 2008-10-01 13:40:52 UTC
Created attachment 27633 [details]
new implementation of Ogg::Page::paginate

The patch goes into directory kde-utils/taglib/taglib

I'm afraid I didn't follow all naming and indentation conventions. Please correct me or point me to code style specs. Thanks
Comment 2 Marc Halbruegge 2008-10-01 18:44:30 UTC
Created attachment 27641 [details]
new implementation of Ogg::Page::paginate (fixed)

if method is Repaginate or the size of the packets exceeds the maximum size of an ogg page, the data is broken into pages of approximately 8KB size
Comment 3 Scott Wheeler 2008-10-08 15:08:34 UTC
*** Bug 172402 has been marked as a duplicate of this bug. ***
Comment 4 Marc Halbruegge 2008-12-15 19:56:18 UTC
Created attachment 29363 [details]
cumulative patch for several bugs

There was another problem when the ogg patch holding the tag data contained an unfinished vorbis packet, too.

I've compiled a cumulative patch, this one fixes:
Bug 167786: ID3 v2.2 album art not being displayed 
Bug 171957: taglib corrupts ogg files 
Bug 175781: riff file tagging interprets trailing garbage
Bug 176159: aiff files with uneven chunk sizes are crashed
Bug 176373: invalid id3v2.2 frames are copied to id3v2.4
Comment 5 Lukáš Lalinský 2009-07-28 20:29:42 UTC
SVN commit 1003745 by lalinsky:

Handle RIFF chunk padding and ignore trailing garbage

This is based on patches by Marc Halbruegge, but those only deal with
read-only cases. The code now also correctly adds padding to RIFF
chunks, and calculates offsets in chunkData taking the padding into
account.

BUG:171957
BUG:175781


 M  +34 -4     taglib/riff/rifffile.cpp  
 M  +4 -0      tests/CMakeLists.txt  
 AM            tests/data/empty.aiff  
 AM            tests/test_aiff.cpp   [License: UNKNOWN]
 AM            tests/test_riff.cpp   [License: UNKNOWN]


WebSVN link: http://websvn.kde.org/?view=rev&revision=1003745
Comment 6 Lukáš Lalinský 2009-07-28 21:01:55 UTC
Sorry, copy&paste error. This is not fixed yet.
Comment 7 Lukáš Lalinský 2009-09-03 19:20:33 UTC
SVN commit 1019459 by lalinsky:

Split Ogg packets larger than 64kb into multiple pages

The implementation is not very efficient, but the current Ogg
code makes it hard to write it properly. :(

Patch by Marc Halbruegge
BUG:171957


 M  +1 -0      NEWS  
 M  +95 -4     taglib/ogg/oggfile.cpp  
 M  +98 -14    taglib/ogg/oggpage.cpp  
 M  +8 -0      taglib/ogg/oggpage.h  
 M  +2 -0      tests/CMakeLists.txt  
 M  +3 -1      tests/Makefile.am  
 AM            tests/test_ogg.cpp   [License: UNKNOWN]


WebSVN link: http://websvn.kde.org/?view=rev&revision=1019459