mirror of
https://github.com/taglib/taglib.git
synced 2025-06-03 09:08:09 -04:00
Merge pull request #161 from TsudaKageyu/fix-syncdata
Fix reading corrupted ID3v2 syncdata
This commit is contained in:
commit
81a9f0474d
@ -49,7 +49,14 @@ TagLib::uint SynchData::toUInt(const ByteVector &data)
|
||||
// Invalid data; assume this was created by some buggy software that just
|
||||
// put normal integers here rather than syncsafe ones, and try it that
|
||||
// way.
|
||||
sum = data.toUInt();
|
||||
if(data.size() >= 4) {
|
||||
sum = data.toUInt(0, true);
|
||||
}
|
||||
else {
|
||||
ByteVector tmp(data);
|
||||
tmp.resize(4);
|
||||
sum = tmp.toUInt(0, true);
|
||||
}
|
||||
}
|
||||
|
||||
return sum;
|
||||
|
Loading…
x
Reference in New Issue
Block a user