mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
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:
parent
76b6d4fc9e
commit
5a40a45cc5
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user