[MPlayer-cvslog] r34738 - trunk/libmpcodecs/dec_audio.c

reimar subversion at mplayerhq.hu
Sun Feb 19 14:49:04 CET 2012


Author: reimar
Date: Sun Feb 19 14:49:04 2012
New Revision: 34738

Log:
Add a safeguard to avoid crash if the decoder e.g. claims 0 channels.
That would be a decoder bug, but an extra check can still help.

Modified:
   trunk/libmpcodecs/dec_audio.c

Modified: trunk/libmpcodecs/dec_audio.c
==============================================================================
--- trunk/libmpcodecs/dec_audio.c	Sun Feb 19 14:39:16 2012	(r34737)
+++ trunk/libmpcodecs/dec_audio.c	Sun Feb 19 14:49:04 2012	(r34738)
@@ -449,6 +449,8 @@ int mp_decode_audio(sh_audio_t *sh_audio
      * more space in the output buffer than the minimum length we try to
      * decode. */
     int max_decode_len = sh_audio->a_buffer_size - sh_audio->audio_out_minsize;
+    if (!unitsize)
+        return -1;
     max_decode_len -= max_decode_len % unitsize;
 
     while (sh_audio->a_out_buffer_len < minlen) {


More information about the MPlayer-cvslog mailing list