summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-12-18 20:25:38 +0100
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-12-18 20:25:38 +0100
commit0deccd94faa1565e28bebefafed7fe32b369d2b9 (patch)
treea5620c4898a328bdc1ed5c808a64de538487799f
parent8d1a32f1880988b27a1da296d0670f24e89954cd (diff)
downloadxine-lib-0deccd94faa1565e28bebefafed7fe32b369d2b9.tar.gz
xine-lib-0deccd94faa1565e28bebefafed7fe32b369d2b9.tar.bz2
Simplify code, set ftyp_atom_size at once.
-rw-r--r--src/demuxers/demux_qt.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c
index 3e5faf390..2fb79fe2a 100644
--- a/src/demuxers/demux_qt.c
+++ b/src/demuxers/demux_qt.c
@@ -700,15 +700,14 @@ static int is_qt_file(input_plugin_t *qt_file) {
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
+ * could be 'moov'
+ * 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)
+ uint64_t ftyp_atom_size = _X_BE_32(&preview[0]) + ATOM_PREAMBLE_SIZE;
+ if (ftyp_atom_size >= MAX_PREVIEW_SIZE)
return 0;
- return _X_BE_32(&preview[i - 4]) == MOOV_ATOM;
+ return _X_BE_32(&preview[ftyp_atom_size - 4]) == MOOV_ATOM;
}
}