Bug 171957 - taglib corrupts ogg files when the tag data exceeds about 64 KB
Summary: taglib corrupts ogg files when the tag data exceeds about 64 KB
Status: RESOLVED FIXED
Alias: None
Product: taglib
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Scott Wheeler
URL:
Keywords:
: 172402 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-01 13:23 UTC by Marc Halbruegge
Modified: 2009-09-03 19:20 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
new implementation of Ogg::Page::paginate (8.27 KB, patch)
2008-10-01 13:40 UTC, Marc Halbruegge
Details
new implementation of Ogg::Page::paginate (fixed) (8.27 KB, patch)
2008-10-01 18:44 UTC, Marc Halbruegge
Details
cumulative patch for several bugs (18.50 KB, patch)
2008-12-15 19:56 UTC, Marc Halbruegge
Details

Note You need to log in before you can comment on or make changes to this bug.
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