[FFmpeg-cvslog] avcodec/g729dec: require buf_size to be non 0
Michael Niedermayer
git at videolan.org
Sun Dec 1 19:57:13 EET 2019
ffmpeg | branch: release/3.4 | Michael Niedermayer <michael at niedermayer.cc> | Sat Nov 9 21:19:24 2019 +0100| [0b49c74fe177fad620dfe3c358d9215e9dbe752f] | committer: Michael Niedermayer
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 at niedermayer.cc>
(cherry picked from commit f64be9da4c8b16071ec84056a61d1fc0d5d6728c)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0b49c74fe177fad620dfe3c358d9215e9dbe752f
---
libavcodec/g729dec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/g729dec.c b/libavcodec/g729dec.c
index 32218e5989..908c12a73a 100644
--- a/libavcodec/g729dec.c
+++ b/libavcodec/g729dec.c
@@ -416,7 +416,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
More information about the ffmpeg-cvslog
mailing list