From 52163428e9de1e5339d2664390126ed9e2be717f Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 7 Jul 2013 00:09:22 +0200 Subject: [PATCH] Break if media headers are corrupt. fix #1828 --- libs/enzyme/mp4.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/enzyme/mp4.py b/libs/enzyme/mp4.py index c53f30d..a66d30a 100644 --- a/libs/enzyme/mp4.py +++ b/libs/enzyme/mp4.py @@ -284,6 +284,10 @@ class MPEG4(core.AVContainer): while datasize: mdia = struct.unpack('>I4s', atomdata[pos:pos + 8]) + + if mdia[0] == 0: + break + if mdia[1] == 'mdhd': # Parse based on version of mdhd header. See # http://wiki.multimedia.cx/index.php?title=QuickTime_container#mdhd