From ed4232cfeb3ab16ee6046f422f5827fa6c4992c8 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Mon, 21 May 2012 18:57:18 -0400 Subject: COMMON: Skip junk found at the end of QuickTime files Can occur in files and is ignored by QuickTime --- common/quicktime.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/quicktime.cpp b/common/quicktime.cpp index 5176f83a35..173d3c6a97 100644 --- a/common/quicktime.cpp +++ b/common/quicktime.cpp @@ -217,7 +217,11 @@ int QuickTimeParser::readDefault(Atom atom) { a.size -= 8; - if (_parseTable[i].type == 0) { // skip leaf atoms data + if (a.size + (uint32)_fd->pos() > (uint32)_fd->size()) { + _fd->seek(_fd->size()); + debug(0, "Skipping junk found at the end of the QuickTime file"); + return 0; + } else if (_parseTable[i].type == 0) { // skip leaf atom data debug(0, ">>> Skipped [%s]", tag2str(a.type)); _fd->seek(a.size, SEEK_CUR); -- cgit v1.2.3