mirror of
https://github.com/mpv-player/mpv
synced 2025-02-07 07:31:48 +00:00
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:
parent
3fa539c4e2
commit
3dc0cfc1fe
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user