]> granicus.if.org Git - taglib/commitdiff
Don't try to parse invalid frames.
authorScott Wheeler <wheeler@kde.org>
Tue, 13 Feb 2007 09:55:56 +0000 (09:55 +0000)
committerScott Wheeler <wheeler@kde.org>
Tue, 13 Feb 2007 09:55:56 +0000 (09:55 +0000)
BUG:137635

git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@633133 283d02a7-25f6-0310-bc7c-ecb5cbfe19da

taglib/mpeg/id3v2/frames/textidentificationframe.cpp

index 8d61378e479ccb6de20d6aff90991fc870febe10..14e966226309d645ad7c5aeeb49c8836aee14ec2 100644 (file)
@@ -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]);