changeset 17581:befc16265bb1

Make sure maxlen is respected, instead of just failing the assert later on.
author reimar
date Fri, 10 Feb 2006 18:21:52 +0000
parents 65530e552f6f
children 43d52074daf9
files libmpcodecs/ad_liba52.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ad_liba52.c	Fri Feb 10 18:18:24 2006 +0000
+++ b/libmpcodecs/ad_liba52.c	Fri Feb 10 18:21:52 2006 +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)