1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

adxdec: Fix division by zero

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-12-18 20:10:51 +01:00
parent bdd62a615a
commit 6b6b84ae16

View File

@ -120,6 +120,8 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
buf += header_size; buf += header_size;
buf_size -= header_size; buf_size -= header_size;
} }
if(c->channels <= 0)
return AVERROR_INVALIDDATA;
/* calculate number of blocks in the packet */ /* calculate number of blocks in the packet */
num_blocks = buf_size / (BLOCK_SIZE * c->channels); num_blocks = buf_size / (BLOCK_SIZE * c->channels);