]> git.sesse.net Git - vlc/commitdiff
Check against 0 sample rate (returned by ffmpeg).
authorLaurent Aimar <fenrir@videolan.org>
Sun, 29 Jun 2008 16:22:19 +0000 (16:22 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 29 Jun 2008 16:22:19 +0000 (16:22 +0000)
modules/codec/avcodec/audio.c

index 40213074ac349438baca44774db4be80eaada732..2a65ad3733ce89390b3d9b7f2f2adfa392d60f0c 100644 (file)
@@ -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;
     }