diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-12-18 20:46:23 +0100 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-12-18 20:46:23 +0100 |
commit | 8e9cb121101b1b43f6b52cd01e3e0fb841c538c6 (patch) | |
tree | 92ec8d9833509f528d933cd2ef0ebe03f98ebd4e | |
parent | 80826e77cf419d92711e175dcc9e40edaecfd7f0 (diff) | |
download | xine-lib-8e9cb121101b1b43f6b52cd01e3e0fb841c538c6.tar.gz xine-lib-8e9cb121101b1b43f6b52cd01e3e0fb841c538c6.tar.bz2 |
Allocate the preview buffer only when actually needed; use zeroed allocation rather than memset().
-rw-r--r-- | src/demuxers/demux_qt.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index 3fb60c1a8..8fb554de2 100644 --- a/src/demuxers/demux_qt.c +++ b/src/demuxers/demux_qt.c @@ -2134,7 +2134,6 @@ static qt_error open_qt_file(qt_info *info, input_plugin_t *input, unsigned char *moov_atom = NULL; off_t moov_atom_offset = -1; int64_t moov_atom_size = -1; - unsigned char preview[MAX_PREVIEW_SIZE]; /* zlib stuff */ z_stream z_state; @@ -2157,7 +2156,7 @@ static qt_error open_qt_file(qt_info *info, input_plugin_t *input, if ((input->get_capabilities(input) & INPUT_CAP_SEEKABLE)) find_moov_atom(input, &moov_atom_offset, &moov_atom_size); else { - memset (&preview, 0, MAX_PREVIEW_SIZE); + unsigned char preview[MAX_PREVIEW_SIZE] = { 0, }; input->get_optional_data(input, preview, INPUT_OPTIONAL_DATA_PREVIEW); if (_X_BE_32(&preview[4]) != MOOV_ATOM) { /* special case if there is an ftyp atom first */ |