From 89b1e54ae041c41ef7c65c40858f8e9b2c72b6b6 Mon Sep 17 00:00:00 2001 From: Scott Wheeler Date: Tue, 13 Feb 2007 09:55:56 +0000 Subject: [PATCH] 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 --- taglib/mpeg/id3v2/frames/textidentificationframe.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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]);