Don't underflow if there are no embedded frames

Closes #513
This commit is contained in:
Scott Wheeler
2015-05-18 17:11:06 +02:00
parent 941efcba18
commit a094ce7dd2
2 changed files with 23 additions and 10 deletions

View File

@ -239,6 +239,11 @@ void ChapterFrame::parseFields(const ByteVector &data)
pos += 4;
size -= pos;
// Embedded frames are optional
if(size < header()->size())
return;
while((uint)embPos < size - header()->size()) {
Frame *frame = FrameFactory::instance()->createFrame(data.mid(pos + embPos), d->tagHeader);