[vlc-devel] commit: Check against 0 sample rate (returned by ffmpeg). (Laurent Aimar )

git version control git at videolan.org
Sun Jun 29 18:21:25 CEST 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Jun 29 16:22:19 2008 +0000| [37402ad5d32c33a0f6f76eda0cb39d6b2339062e]

Check against 0 sample rate (returned by ffmpeg).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=37402ad5d32c33a0f6f76eda0cb39d6b2339062e
---

 modules/codec/avcodec/audio.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c
index 4021307..2a65ad3 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;
     }




More information about the vlc-devel mailing list