mirror of
https://github.com/taglib/taglib.git
synced 2026-07-14 15:21:31 -04:00
- Fixed crash in AttachedPictureFrame and GeneralEncapsulatedObjectFrame
caused by using uninitialized pointer. (BUG:151078) - Make Frame::readStringField to actually read the string field. - Fixed parsing of APIC frames -- there is one-byte type between mime type and description. The code worked only thanks to the previous bug. git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@735035 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
@@ -54,8 +54,8 @@ AttachedPictureFrame::AttachedPictureFrame() : Frame("APIC")
|
||||
|
||||
AttachedPictureFrame::AttachedPictureFrame(const ByteVector &data) : Frame(data)
|
||||
{
|
||||
setData(data);
|
||||
d = new AttachedPictureFramePrivate;
|
||||
setData(data);
|
||||
}
|
||||
|
||||
AttachedPictureFrame::~AttachedPictureFrame()
|
||||
@@ -132,9 +132,10 @@ void AttachedPictureFrame::parseFields(const ByteVector &data)
|
||||
|
||||
d->textEncoding = String::Type(data[0]);
|
||||
|
||||
int pos = 1;
|
||||
int pos = 1;
|
||||
|
||||
d->mimeType = readStringField(data, String::Latin1, &pos);
|
||||
d->mimeType = readStringField(data, String::Latin1, &pos);
|
||||
d->type = (TagLib::ID3v2::AttachedPictureFrame::Type)data[pos++];
|
||||
d->description = readStringField(data, d->textEncoding, &pos);
|
||||
|
||||
d->data = data.mid(pos);
|
||||
|
||||
@@ -55,8 +55,8 @@ GeneralEncapsulatedObjectFrame::GeneralEncapsulatedObjectFrame() : Frame("GEOB")
|
||||
|
||||
GeneralEncapsulatedObjectFrame::GeneralEncapsulatedObjectFrame(const ByteVector &data) : Frame(data)
|
||||
{
|
||||
setData(data);
|
||||
d = new GeneralEncapsulatedObjectFramePrivate;
|
||||
setData(data);
|
||||
}
|
||||
|
||||
GeneralEncapsulatedObjectFrame::~GeneralEncapsulatedObjectFrame()
|
||||
|
||||
@@ -202,9 +202,11 @@ String Frame::readStringField(const ByteVector &data, String::Type encoding, int
|
||||
if(end < *position)
|
||||
return String::null;
|
||||
|
||||
String str = String(data.mid(*position, end - *position), encoding);
|
||||
|
||||
*position = end + delimiter.size();
|
||||
|
||||
return String(data.mid(*position, end - *position), encoding);
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user