mirror of
https://github.com/taglib/taglib.git
synced 2025-07-17 20:44:20 -04:00
ID3v2: Bounds check a vector's size
If the provided vector is empty then `data[0]` dereferences a nullptr, so add a check that this won't be the case before reading the encoding.
This commit is contained in:
committed by
Urs Fleisch
parent
3391bd80c4
commit
1d3e080f04
@ -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;
|
||||
|
Reference in New Issue
Block a user