[MPlayer-cvslog] r32706 - trunk/libmpcodecs/ad_faad.c

reimar subversion at mplayerhq.hu
Sun Dec 12 14:56:36 CET 2010


Author: reimar
Date: Sun Dec 12 14:56:35 2010
New Revision: 32706

Log:
Fix ad_faad crash when used on an empty audio stream.

Modified:
   trunk/libmpcodecs/ad_faad.c

Modified: trunk/libmpcodecs/ad_faad.c
==============================================================================
--- trunk/libmpcodecs/ad_faad.c	Sun Dec 12 13:51:32 2010	(r32705)
+++ trunk/libmpcodecs/ad_faad.c	Sun Dec 12 14:56:35 2010	(r32706)
@@ -127,6 +127,11 @@ static int init(sh_audio_t *sh)
     faacDecSetConfiguration(faac_hdec, faac_conf);
 
     sh->a_in_buffer_len = demux_read_data(sh->ds, sh->a_in_buffer, sh->a_in_buffer_size);
+    if (!sh->a_in_buffer_len) {
+      // faad init will crash with 0 buffer length
+      mp_msg(MSGT_DECAUDIO, MSGL_FATAL, "Could not get audio data!\n");
+      return 0;
+    }
 #if CONFIG_FAAD_INTERNAL
     /* init the codec, look for LATM */
     faac_init = faacDecInit(faac_hdec, sh->a_in_buffer,


More information about the MPlayer-cvslog mailing list