[MPlayer-dev-eng] [PATCH] ad_liba52.c and maxlen

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sat Jan 28 17:02:44 CET 2006


Hi,
oh joy, I discovered another codec that completely ignores maxlen
(thanks (well, that's not really a thanks...) to
http://bugs.gentoo.org/show_bug.cgi?id=120313).
Please check and test the attached patch.
Oh, and I'm tempted to give the crown for the most ugly and stupid code
in MPlayer to that file.

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libmpcodecs/ad_liba52.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_liba52.c,v
retrieving revision 1.19
diff -u -r1.19 ad_liba52.c
--- libmpcodecs/ad_liba52.c	18 Nov 2005 14:39:21 -0000	1.19
+++ libmpcodecs/ad_liba52.c	28 Jan 2006 15:59:12 -0000
@@ -288,6 +288,10 @@
     sample_t level=a52_level, bias=384;
     int flags=a52_flags|A52_ADJUST_LEVEL;
     int i,len=-1;
+	if (maxlen / sh_audio->samplesize / 256 / sh_audio->channels < 6) {
+	    mp_msg(MSGT_DECAUDIO, MSGL_V, "maxlen too small in decode_audio\n");
+	    return len;
+	}
 	if (sh_audio->sample_format == AF_FORMAT_FLOAT_NE)
 	    bias = 0;
 	if(!sh_audio->a_in_buffer_len) 


More information about the MPlayer-dev-eng mailing list