adxdec: Fix division by zero

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6b6b84ae16)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2011-12-18 20:10:51 +01:00
parent 2bbda9872f
commit cb42ed171d
+2
View File
@@ -120,6 +120,8 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
buf += header_size;
buf_size -= header_size;
}
if(c->channels <= 0)
return AVERROR_INVALIDDATA;
/* calculate number of blocks in the packet */
num_blocks = buf_size / (BLOCK_SIZE * c->channels);