mirror of
https://github.com/taglib/taglib.git
synced 2025-06-04 01:28:21 -04:00
ID3v2: Return early from decode() on invalid data
The while loop in this function assumes that `data.end() - 1` is less than `data.end()`, which isn't the case if `data` is empty since `data.end()` can be a nullptr.
This commit is contained in:
parent
f2eb331696
commit
51ae5748cb
@ -74,6 +74,10 @@ ByteVector SynchData::fromUInt(unsigned int value)
|
||||
|
||||
ByteVector SynchData::decode(const ByteVector &data)
|
||||
{
|
||||
if (data.size() == 0) {
|
||||
return ByteVector();
|
||||
}
|
||||
|
||||
// We have this optimized method instead of using ByteVector::replace(),
|
||||
// since it makes a great difference when decoding huge unsynchronized frames.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user