diff --git a/taglib/mpeg/id3v2/frames/ownershipframe.cpp b/taglib/mpeg/id3v2/frames/ownershipframe.cpp index 0b180dbf..3173d1fc 100644 --- a/taglib/mpeg/id3v2/frames/ownershipframe.cpp +++ b/taglib/mpeg/id3v2/frames/ownershipframe.cpp @@ -117,6 +117,11 @@ void OwnershipFrame::parseFields(const ByteVector &data) { int pos = 0; + // Need at least 1 byte for the encoding + if(data.size() - pos < 1) { + return; + } + // Get the text encoding d->textEncoding = String::Type(data[0]); pos += 1;