mirror of
https://github.com/taglib/taglib.git
synced 2026-02-04 22:40:12 -05:00
Fix ID3v2::UniqueFileIdentifier frame parsing.
According to the spec, the identifier contains arbitrary binary data (which includes \0). That means splitting it on \0 and checking if we have only two parts is wrong, because it rejects valid frames. git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@735109 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
@ -24,6 +24,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include <tbytevectorlist.h>
|
||||
#include <tdebug.h>
|
||||
|
||||
#include "uniquefileidentifierframe.h"
|
||||
|
||||
@ -88,13 +89,14 @@ String UniqueFileIdentifierFrame::toString() const
|
||||
|
||||
void UniqueFileIdentifierFrame::parseFields(const ByteVector &data)
|
||||
{
|
||||
ByteVectorList fields = ByteVectorList::split(data, char(0));
|
||||
|
||||
if(fields.size() != 2)
|
||||
if(data.size() < 1) {
|
||||
debug("An UFID frame must contain at least 1 byte.");
|
||||
return;
|
||||
}
|
||||
|
||||
d->owner = fields.front();
|
||||
d->identifier = fields.back();
|
||||
int pos = 0;
|
||||
d->owner = readStringField(data, String::Latin1, &pos);
|
||||
d->identifier = data.mid(pos);
|
||||
}
|
||||
|
||||
ByteVector UniqueFileIdentifierFrame::renderFields() const
|
||||
|
||||
Reference in New Issue
Block a user