Browse code

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>

Michael Niedermayer authored on 2019/11/10 05:19:24
Showing 1 changed files
... ...
@@ -416,7 +416,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
416 416
         return ret;
417 417
     out_frame = (int16_t*) frame->data[0];
418 418
 
419
-    if (buf_size % 10 == 0) {
419
+    if (buf_size && buf_size % 10 == 0) {
420 420
         packet_type = FORMAT_G729_8K;
421 421
         format = &format_g729_8k;
422 422
         //Reset voice decision