From fd2f3ae53a012de85072e0f59dcb752639e886ec Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Wed, 3 Dec 2003 03:14:32 +0000 Subject: 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 --- src/demuxers/demux_avi.c | 8 +++++--- 1 file 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; iavi->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 */ -- cgit v1.2.3