diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-09 21:19:24 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-01 17:17:04 +0100 |
commit | f64be9da4c8b16071ec84056a61d1fc0d5d6728c (patch) | |
tree | e58a8886b79a10821c76bfb2c558ea7d5f11718a /libavcodec/g729dec.c | |
parent | d468da8d7960e1d08a6fbf6189a4f6d67e9dfee3 (diff) | |
download | ffmpeg-f64be9da4c8b16071ec84056a61d1fc0d5d6728c.tar.gz |
avcodec/g729dec: require buf_size to be non 0
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>
Diffstat (limited to 'libavcodec/g729dec.c')
-rw-r--r-- | libavcodec/g729dec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/g729dec.c b/libavcodec/g729dec.c index eafac8a023..282668d472 100644 --- a/libavcodec/g729dec.c +++ b/libavcodec/g729dec.c @@ -427,7 +427,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 |