diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-12-29 22:29:09 +0100 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-12-29 22:29:09 +0100 |
commit | 3c7b43e32e0d128e13a693cb45790927ebf3edd4 (patch) | |
tree | 0c75a38fb12a764e136ca1fa73fddbbd1b23cfb4 /src | |
parent | 38b3af7f90924773014e53ef4a3fff01572d262e (diff) | |
download | xine-lib-3c7b43e32e0d128e13a693cb45790927ebf3edd4.tar.gz xine-lib-3c7b43e32e0d128e13a693cb45790927ebf3edd4.tar.bz2 |
Only check for the chunk's size to be lesser than 100 when reading the COMM_TAG.
This way, bigger audio chunks won't make the demuxer fail.
Fixes bug #6.
Diffstat (limited to 'src')
-rw-r--r-- | src/demuxers/demux_aiff.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/demuxers/demux_aiff.c b/src/demuxers/demux_aiff.c index 7fcaea70e..3f2d0df11 100644 --- a/src/demuxers/demux_aiff.c +++ b/src/demuxers/demux_aiff.c @@ -87,7 +87,6 @@ static int open_aiff_file(demux_aiff_t *this) { unsigned char preamble[PREAMBLE_SIZE]; unsigned int chunk_type; unsigned int chunk_size; - unsigned char buffer[100]; if (_x_demux_read_header(this->input, signature, AIFF_SIGNATURE_SIZE) != AIFF_SIGNATURE_SIZE) return 0; @@ -118,13 +117,15 @@ static int open_aiff_file(demux_aiff_t *this) { chunk_type = _X_BE_32(&preamble[0]); chunk_size = _X_BE_32(&preamble[4]); - if (chunk_size > sizeof(buffer) / sizeof(buffer[0])) { - /* the chunk is too large to fit in the buffer -> this cannot be an aiff chunk */ - this->status = DEMUX_FINISHED; - return 0; - } - if (chunk_type == COMM_TAG) { + unsigned char buffer[100]; + + if (chunk_size > sizeof(buffer) / sizeof(buffer[0])) { + /* the chunk is too large to fit in the buffer -> this cannot be an aiff chunk */ + this->status = DEMUX_FINISHED; + return 0; + } + if (this->input->read(this->input, buffer, chunk_size) != chunk_size) { this->status = DEMUX_FINISHED; |