0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

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
This commit is contained in:
reimar 2006-02-10 18:21:52 +00:00
parent 4d7b6d85b6
commit 67569814d9

View File

@ -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)