From 8d1a32f1880988b27a1da296d0670f24e89954cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 18 Dec 2007 20:21:41 +0100 Subject: Return right away if the atom is not an FTYP. --- src/demuxers/demux_qt.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index 402b7be99..3e5faf390 100644 --- a/src/demuxers/demux_qt.c +++ b/src/demuxers/demux_qt.c @@ -696,19 +696,19 @@ static int is_qt_file(input_plugin_t *qt_file) { if (_X_BE_32(&preview[4]) == MOOV_ATOM) return 1; else { - if (_X_BE_32(&preview[4]) == FTYP_ATOM) { - /* show some lenience if the first atom is 'ftyp'; the second atom - * could be 'moov' */ - moov_atom_size = _X_BE_32(&preview[0]); - /* compute the size of the current atom plus the preamble of the - * next atom; if the size is within the range on the preview buffer - * then the next atom's preamble is in the preview buffer */ - i = moov_atom_size + ATOM_PREAMBLE_SIZE; - if (i >= MAX_PREVIEW_SIZE) - return 0; - return _X_BE_32(&preview[i - 4]) == MOOV_ATOM; - } else - return 0; + if (_X_BE_32(&preview[4]) != FTYP_ATOM) + return 0; + + /* show some lenience if the first atom is 'ftyp'; the second atom + * could be 'moov' */ + moov_atom_size = _X_BE_32(&preview[0]); + /* compute the size of the current atom plus the preamble of the + * next atom; if the size is within the range on the preview buffer + * then the next atom's preamble is in the preview buffer */ + i = moov_atom_size + ATOM_PREAMBLE_SIZE; + if (i >= MAX_PREVIEW_SIZE) + return 0; + return _X_BE_32(&preview[i - 4]) == MOOV_ATOM; } } -- cgit v1.2.3