From 37402ad5d32c33a0f6f76eda0cb39d6b2339062e Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Sun, 29 Jun 2008 16:22:19 +0000 Subject: [PATCH] Check against 0 sample rate (returned by ffmpeg). --- modules/codec/avcodec/audio.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c index 40213074ac..2a65ad3733 100644 --- a/modules/codec/avcodec/audio.c +++ b/modules/codec/avcodec/audio.c @@ -307,10 +307,11 @@ aout_buffer_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block ) p_block->i_buffer -= i_used; p_block->p_buffer += i_used; - if( p_sys->p_context->channels <= 0 || p_sys->p_context->channels > 6 ) + if( p_sys->p_context->channels <= 0 || p_sys->p_context->channels > 6 || + p_sys->p_context->sample_rate <= 0 ) { - msg_Warn( p_dec, "invalid channels count %d", - p_sys->p_context->channels ); + msg_Warn( p_dec, "invalid audio properties channels count %d, sample rate %d", + p_sys->p_context->channels, p_sys->p_context->sample_rate ); block_Release( p_block ); return NULL; } -- 2.39.2