From taglib-devel Sun Sep 04 20:55:44 2005 From: Scott Wheeler Date: Sun, 04 Sep 2005 20:55:44 +0000 To: taglib-devel Subject: Re: [patch] fix zero length ID3v2 frames Message-Id: <200509042255.44717.wheeler () kde ! org> X-MARC-Message: https://marc.info/?l=taglib-devel&m=112586735327389 On Wednesday 31 August 2005 12:27, Andrew de Quincey wrote: > Hi, I had a couple of mp3 files that taglib just ignored the ID3 contents > of. Turns out they have several 0 length frames in them. > > The attached patch makes taglib ignore any zero length frames completely, > while still parsing other frames correctly. I thought this would be more > fault tolerant than just attempting to parse them as normal frames - e.g. > in case we find a 0 length text frame, which would be quite invalid (no > text encoding information). I'm not quite sure on this one -- the frames will definitely need to be discarded since per the ID3v2 spec frames are required to contain at least one byte of information. The remaining question is what to do when broken frames are encountered. I'll probably apply some version of this, but there's still a case that worries me: There's no offset table for frames in ID3v2, so you have to iterate through them when parsing. When frames have invalid values they're often just wrong -- i.e. it might say "0" and then actual content follows. That throws off the rest of the parsing and can cause some strange errors... -Scott -- The fact that an opinion has been widely held is no evidence whatever that it is not utterly absurd. --Bertrand Russell _______________________________________________ taglib-devel mailing list taglib-devel@kde.org https://mail.kde.org/mailman/listinfo/taglib-devel