mirror of
https://github.com/mpv-player/mpv
synced 2025-03-19 18:05:21 +00: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:
parent
4d7b6d85b6
commit
67569814d9
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user