summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-02-10 18:21:52 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-02-10 18:21:52 +0000
commit67569814d9c53f90cd4fdf57b75f23fc67ecbb7c (patch)
tree9afd98a197e4e6e2e6112534d94af22da905f444 /libmpcodecs
parent4d7b6d85b619d1b68594ed82a4f23c027917a7aa (diff)
downloadmpv-67569814d9c53f90cd4fdf57b75f23fc67ecbb7c.tar.bz2
mpv-67569814d9c53f90cd4fdf57b75f23fc67ecbb7c.tar.xz
Make sure maxlen is respected, instead of just failing the assert later on.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17582 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/ad_liba52.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libmpcodecs/ad_liba52.c b/libmpcodecs/ad_liba52.c
index a8a8317deb..dbdb89a619 100644
--- a/libmpcodecs/ad_liba52.c
+++ b/libmpcodecs/ad_liba52.c
@@ -288,6 +288,10 @@ static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int m
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)