summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-12-18 20:21:41 +0100
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-12-18 20:21:41 +0100
commit8d1a32f1880988b27a1da296d0670f24e89954cd (patch)
tree9d08d1f946f96a289cd1aaa676c195620caf5e64
parentccb545fca89e270271b9ace18289db433e2e1d09 (diff)
downloadxine-lib-8d1a32f1880988b27a1da296d0670f24e89954cd.tar.gz
xine-lib-8d1a32f1880988b27a1da296d0670f24e89954cd.tar.bz2
Return right away if the atom is not an FTYP.
-rw-r--r--src/demuxers/demux_qt.c26
1 files 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;
}
}