<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19019">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">Hi All,<?xml:namespace prefix = o ns
= "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><o:p> </o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">We’ve ran across quite a few tracks
with empty WCOM frames in id3v2 tags. <o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><SPAN
style="mso-tab-count: 1">
</SPAN>- Contents of WCOM:<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><SPAN
style="mso-tab-count: 2">
</SPAN>* frameID=WCOM<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><SPAN
style="mso-tab-count: 2">
</SPAN>* frameSize = 0<SPAN
style="mso-tab-count: 4">
</SPAN><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><SPAN
style="mso-tab-count: 2">
</SPAN>* d->dataLengthIndicator = false<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><o:p> </o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">Taglib rejects the frame as invalid
in id3v2framefactory.cpp and id3v2tag.cpp and invalidates the complete
tag.</SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">According to //id3.org/id3v2.3.0 the
frame is actually illegal, so taglibs reaction is technically
correct.</SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><o:p></o:p></SPAN> </P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">3.3. ID3v2 frame
overview<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"> </SPAN>A tag must contain at least
one frame. A frame must be at least 1 byte big, excluding
the<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes">
</SPAN>header.<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><o:p> </o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">However, many other parsers skip the
bad frame and continue parsing the tag, for instance<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">Winamp, Mp3tag, iTunes. Would a
better method be to check for a valid field following the empty
field,<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">and then continue
parsing?</SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><o:p> </o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">Although the same issue exists for
the code in taglib.git at master, f</SPAN><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">or illustration of the problem and
not a suggested fix, </SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">the following two patches to version
1.7 allow the id3v2 tags with empty WCOM fields </SPAN><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">to be parsed:</SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><o:p> <FONT
face="Times New Roman">===========================</FONT></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">diff --git
a/taglib-1.7/taglib/mpeg/id3v2/id3v2framefactory.cpp
b/taglib-1.7/taglib/mpeg/id3v2/id3v2framefactory.cpp<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">index c531aaa..4fab414
100755<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">---
a/taglib-1.7/taglib/mpeg/id3v2/id3v2framefactory.cpp<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">+++
b/taglib-1.7/taglib/mpeg/id3v2/id3v2framefactory.cpp<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">@@ -105,9 +105,12 @@ Frame
*FrameFactory::createFrame(const ByteVector &origData, Header
*tagHeader)<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"> </SPAN><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"> </SPAN>// A quick sanity check -- make
sure that the frameID is 4 uppercase Latin1<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"> </SPAN>// characters.<SPAN
style="mso-spacerun: yes"> </SPAN>Also make sure that there is data in the
frame.<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">-<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">-<SPAN
style="mso-spacerun: yes"> </SPAN>if(!frameID.size() == (version < 3 ?
3 : 4) ||<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">+//MED <o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">+/*<SPAN
style="mso-spacerun: yes"> </SPAN>if(!frameID.size() == (version < 3 ?
3 : 4) ||<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes">
</SPAN>header->frameSize() <= uint(header->dataLengthIndicator() ? 4 :
0) ||<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">+ */<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">+<SPAN
style="mso-spacerun: yes"> </SPAN>if(frameID.size() != (version < 3 ? 3
: 4) ||<SPAN
style="mso-tab-count: 2">
</SPAN>/*1.8 fix*/<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">+<SPAN
style="mso-spacerun: yes">
</SPAN>(header->dataLengthIndicator() &&<SPAN
style="mso-spacerun: yes"> </SPAN>(header->frameSize() <= uint(4)) )
|| /*Empty URL fix*/<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes">
</SPAN>header->frameSize() > data.size())<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"> </SPAN>{<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"> </SPAN>delete
header;</SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"></SPAN> </P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">=======================</SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">diff --git
a/taglib-1.7/taglib/mpeg/id3v2/id3v2tag.cpp
b/taglib-1.7/taglib/mpeg/id3v2/id3v2tag.cpp<BR>index 7e8012b..3fb5148
100755<BR>--- a/taglib-1.7/taglib/mpeg/id3v2/id3v2tag.cpp<BR>+++
b/taglib-1.7/taglib/mpeg/id3v2/id3v2tag.cpp<BR>@@ -446,12 +446,14 @@ void
ID3v2::Tag::parse(const ByteVector
&origData)<BR>
return;<BR> <BR> // Checks to make sure that frame
parsed correctly.<BR>-<BR>- if(frame->size() <= 0)
{<BR>+//MED - empty URL fix<BR>+//Add check somehow for
frame.d.header.d.dataLengthIndicator()<BR>+// if(frame->size() <=0
&& frame.d.header.d.dataLengthIndicator()<BR>+/*
if(frame->size() <= 0) {<BR> delete
frame;<BR>
return;<BR> }<BR>-<BR>+*/<BR>
frameDataPosition += frame->size() +
Frame::headerSize(d->header.majorVersion());<BR>
addFrame(frame);<BR> }</SPAN></P><SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><BR><o:p>Thanks for any
help.</o:p></P>
<P style="MARGIN: 0in 0in 0pt"
class=MsoNormal><o:p></o:p></SPAN> </P></FONT></DIV></BODY></HTML>