diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-12-03 03:14:32 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-12-03 03:14:32 +0000 |
commit | fd2f3ae53a012de85072e0f59dcb752639e886ec (patch) | |
tree | 7dd3170eb6a2645776706024ae161a0eee8af28d | |
parent | d10ebcc967cd804d220dd92a09480bc37e086cd6 (diff) | |
download | xine-lib-fd2f3ae53a012de85072e0f59dcb752639e886ec.tar.gz xine-lib-fd2f3ae53a012de85072e0f59dcb752639e886ec.tar.bz2 |
avoid crashing with big wavex headers.
maybe they should be broken into smaller pieces, but decoders would
need to be fixed to support it.
CVS patchset: 5826
CVS date: 2003/12/03 03:14:32
-rw-r--r-- | src/demuxers/demux_avi.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 43d09f906..6344dd30c 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.c @@ -19,7 +19,7 @@ */ /* - * $Id: demux_avi.c,v 1.183 2003/11/26 23:44:09 f1rmb Exp $ + * $Id: demux_avi.c,v 1.184 2003/12/03 03:14:32 miguelfreitas Exp $ * * demultiplexer for avi streams * @@ -1575,12 +1575,14 @@ static void demux_avi_send_headers (demux_plugin_t *this_gen) { if (this->audio_fifo) { for (i=0; i<this->avi->n_audio; i++) { + int wavex_len; avi_audio_t *a = this->avi->audio[i]; buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); + wavex_len = (a->wavex_len < buf->max_size) ? a->wavex_len : buf->max_size; buf->decoder_flags = BUF_FLAG_HEADER; - memcpy (buf->content, a->wavex, a->wavex_len); - buf->size = a->wavex_len; + memcpy (buf->content, a->wavex, wavex_len); + buf->size = wavex_len; buf->type = a->audio_type | i; buf->decoder_info[0] = 0; /* first package, containing wavex */ buf->decoder_info[1] = a->wavex->nSamplesPerSec; /* Audio Rate */ |