# HG changeset patch # User reimar # Date 1329659344 0 # Node ID dc78fbe1f17f3b6e558b6f820033d2b49018e1c0 # Parent 6dcc91eb3cf8341b20e8bee1ad4dfb29235a553e 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. diff -r 6dcc91eb3cf8 -r dc78fbe1f17f libmpcodecs/dec_audio.c --- a/libmpcodecs/dec_audio.c Sun Feb 19 13:39:16 2012 +0000 +++ b/libmpcodecs/dec_audio.c Sun Feb 19 13:49:04 2012 +0000 @@ -449,6 +449,8 @@ * 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 (sh_audio->a_out_buffer_len < minlen) {