Make sure we are not trying to read a file where MP4 atom header != 8 bytes

git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@1042945 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
Lukáš Lalinský 2009-10-31 08:36:26 +00:00
parent 76b6d4fc9e
commit 5a40a45cc5

View File

@ -44,6 +44,15 @@ MP4::Atom::Atom(File *file)
{
offset = file->tell();
ByteVector header = file->readBlock(8);
if (header.size() != 8) {
// The atom header must be 8 bytes long, otherwise there is either
// trailing garbage or the file is truncated
debug("MP4: Expected 8 bytes of atom header");
length = 0;
file->seek(0, File::End);
return;
}
length = header.mid(0, 4).toUInt();
if (length == 1) {