aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Hoops2012-05-21 18:57:18 -0400
committerMatthew Hoops2012-05-21 18:57:18 -0400
commited4232cfeb3ab16ee6046f422f5827fa6c4992c8 (patch)
tree1c2b747735a0aadbefc293469495e50a209a7e90
parentb678dca1c01be742b9d020b3be481aa3ce562eaf (diff)
downloadscummvm-rg350-ed4232cfeb3ab16ee6046f422f5827fa6c4992c8.tar.gz
scummvm-rg350-ed4232cfeb3ab16ee6046f422f5827fa6c4992c8.tar.bz2
scummvm-rg350-ed4232cfeb3ab16ee6046f422f5827fa6c4992c8.zip
COMMON: Skip junk found at the end of QuickTime files
Can occur in files and is ignored by QuickTime
-rw-r--r--common/quicktime.cpp6
1 files changed, 5 insertions, 1 deletions
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);