aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qt-faststart.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2010-05-13 19:22:56 +0000
committerMartin Storsjö <martin@martin.st>2010-05-13 19:22:56 +0000
commit86e09922a52468632a80f23031fde44ec9d1b976 (patch)
treece95318d972b3b960b08f154952531af63db9fd1 /tools/qt-faststart.c
parent6d810162823c2c76088df267c5c3e07e07b1437a (diff)
downloadffmpeg-86e09922a52468632a80f23031fde44ec9d1b976.tar.gz
qt-faststart: Abort scanning of the input file if a badly sized atom is encountered
If the atom size is 0, qt-faststart currently hangs forever while scanning the file. Originally committed as revision 23129 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'tools/qt-faststart.c')
-rw-r--r--tools/qt-faststart.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/qt-faststart.c b/tools/qt-faststart.c
index dca5db1153..7bcd5b72bd 100644
--- a/tools/qt-faststart.c
+++ b/tools/qt-faststart.c
@@ -163,6 +163,12 @@ int main(int argc, char *argv[])
break;
}
atom_offset += atom_size;
+
+ /* The atom header is 8 (or 16 bytes), if the atom size (which
+ * includes these 8 or 16 bytes) is less than that, we won't be
+ * able to continue scanning sensibly after this atom, so break. */
+ if (atom_size < 8)
+ break;
}
if (atom_type != MOOV_ATOM) {