Message ID | 20191109223907.11014-2-michael@niedermayer.cc |
---|---|
State | Accepted |
Commit | f64be9da4c8b16071ec84056a61d1fc0d5d6728c |
Headers | show |
diff --git a/libavcodec/g729dec.c b/libavcodec/g729dec.c index ffccbc431b..d728b388b4 100644 --- a/libavcodec/g729dec.c +++ b/libavcodec/g729dec.c @@ -424,7 +424,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) return ret; - if (buf_size % ((G729_8K_BLOCK_SIZE + (avctx->codec_id == AV_CODEC_ID_ACELP_KELVIN)) * avctx->channels) == 0) { + if (buf_size && buf_size % ((G729_8K_BLOCK_SIZE + (avctx->codec_id == AV_CODEC_ID_ACELP_KELVIN)) * avctx->channels) == 0) { packet_type = FORMAT_G729_8K; format = &format_g729_8k; //Reset voice decision
The 0 case was added with the support for multiple packets. It appears unintended and causes extra complexity and out of array accesses (though within padding) No testcase Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavcodec/g729dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)