Bug 121935 - Parser prematurely exits when hitting a null tag
Summary: Parser prematurely exits when hitting a null tag
Status: RESOLVED INTENTIONAL
Alias: None
Product: taglib
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Scott Wheeler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-14 02:01 UTC by mike smithwick
Modified: 2006-06-17 07:23 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mike smithwick 2006-02-14 02:01:14 UTC
Version:           1.4 (using KDE Devel)
Installed from:    Compiled sources
Compiler:          MS VC 7 
OS:                MS Windows

The MusicMatch (ugh!) Tag editor can produce completely NULL tags. That is, a tag with 6 bytes null header info, and 0 length data. By definition, a tag field must have 1 byte of data. Taglib will bail out completely when it comes across one of these bad tags and all successive fields will be skipped. It should just ignore the bad field and move to the next one. The relevant code is in id3v2tag.cpp, about line 436 (in 1.4). We changed the code:     

if(!frame)
       return;

To:

      if(!frame)

      {

          frameDataPosition += Frame::headerSize(d->header.majorVersion());

            continue;

      }

 
And it seems to work fine.
Comment 1 Scott Wheeler 2006-06-17 07:23:05 UTC
This is one that I've thought about off and on for a while and for the moment I've decided not to apply.  Most of those sorts of checks aren't there just to be pedantic and follow standards, but to try to detect corrupted files before the parser gets confused.

If this is something that you're really seeing often, first, please try to report it to the MusicMatch guys and see what they come back with -- let me know the results of that and then I'll see if there's maybe a happy medium, but if this is happening on, say, one file in 1000 tagged with MusicMatch then it's really not worth giving up a sanity check over.