dec_audio: add sanity check against 0 channels

Add a safeguard to avoid crash if the decoder e.g. claims 0 channels.
That would be a decoder bug, but an extra check can still help.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34738 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
This commit is contained in:
mplayer-svn 2012-02-19 13:49:04 +00:00 committed by wm4
parent 3fa539c4e2
commit 3dc0cfc1fe
1 changed files with 2 additions and 0 deletions

View File

@ -409,6 +409,8 @@ int decode_audio(sh_audio_t *sh_audio, struct bstr *outbuf, int minlen)
* more space in the output buffer than the minimum length we try to
* decode. */
int max_decode_len = sh_audio->a_buffer_size - sh_audio->audio_out_minsize;
if (!unitsize)
return -1;
max_decode_len -= max_decode_len % unitsize;
while (outbuf->len < minlen) {