Fix parsing of regular 32-bit integers in SynchData::toUInt()

BUG:231075


git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@1115275 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
Lukáš Lalinský
2010-04-15 20:22:21 +00:00
parent f6478a4172
commit 9dcdecc810
5 changed files with 40 additions and 9 deletions

View File

@ -46,14 +46,10 @@ TagLib::uint SynchData::toUInt(const ByteVector &data)
}
if(notSynchSafe) {
/*
* 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 = 0;
for(int i = 0; i <= last; i++)
sum |= data[i] << ((last - i) * 8);
// 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.size() > 4) ? data.mid(0, 4).toUInt() : data.toUInt();
}
return sum;