aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-11-09 21:19:24 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-12-31 19:51:56 +0100
commitc98cecea591d821446acabd13894c33566db6ec3 (patch)
treefcbe966a74c89bd10348d3cac7109e6c8a8d5139
parentd808a43e293c5fc7c48756e9df4e27677e088090 (diff)
downloadffmpeg-c98cecea591d821446acabd13894c33566db6ec3.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> (cherry picked from commit f64be9da4c8b16071ec84056a61d1fc0d5d6728c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/g729dec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/g729dec.c b/libavcodec/g729dec.c
index 5a07e61482..b3680dbd7f 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->channels) == 0) {
+ if (buf_size && buf_size % (G729_8K_BLOCK_SIZE * avctx->channels) == 0) {
packet_type = FORMAT_G729_8K;
format = &format_g729_8k;
//Reset voice decision