From: Scott Wheeler Date: Tue, 13 Feb 2007 09:55:56 +0000 (+0000) Subject: Don't try to parse invalid frames. X-Git-Tag: v1.5~154 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=89b1e54ae041c41ef7c65c40858f8e9b2c72b6b6;p=taglib Don't try to parse invalid frames. BUG:137635 git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@633133 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- diff --git a/taglib/mpeg/id3v2/frames/textidentificationframe.cpp b/taglib/mpeg/id3v2/frames/textidentificationframe.cpp index 8d61378e..14e96622 100644 --- a/taglib/mpeg/id3v2/frames/textidentificationframe.cpp +++ b/taglib/mpeg/id3v2/frames/textidentificationframe.cpp @@ -94,6 +94,11 @@ void TextIdentificationFrame::setTextEncoding(String::Type encoding) void TextIdentificationFrame::parseFields(const ByteVector &data) { + // Don't try to parse invalid frames + + if(data.size() < 2) + return; + // read the string data type (the first byte of the field data) d->textEncoding = String::Type(data[0]);