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-06 20:30:58 +0100
commit4708c410e21e6e948f779a4752bbb8cd26ef164a (patch)
treedec4f8e5b4a7d3fdbf5597ef1918fd658d18f25d
parentfcc8c187fbdead5fa1b2973aee0f4e1fe2f06d34 (diff)
downloadffmpeg-4708c410e21e6e948f779a4752bbb8cd26ef164a.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 8bd7a7c166..42e1b4402c 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,
return ret;
out_frame = (int16_t*) frame->data[0];
- if (buf_size % 10 == 0) {
+ if (buf_size && buf_size % 10 == 0) {
packet_type = FORMAT_G729_8K;
format = &format_g729_8k;
//Reset voice decision