Don't overrun the buffer if the first byte is 0xff

git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@553365 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
Scott Wheeler 2006-06-20 20:41:30 +00:00
parent a6aeaef64e
commit 3856f38655

View File

@ -452,7 +452,7 @@ long MPEG::File::nextFrameOffset(long position)
seek(position);
buffer = readBlock(bufferSize());
for(uint i = 0; i < buffer.size(); i++) {
for(uint i = 0; i < buffer.size() - 1; i++) {
if(uchar(buffer[i]) == 0xff && secondSynchByte(buffer[i + 1]))
return position + i;
}