Skip to content
Snippets Groups Projects
Commit 0b49c74f authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

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: default avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f64be9da)
Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
parent 4d932eb6
No related branches found
No related tags found
No related merge requests found
...@@ -416,7 +416,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, ...@@ -416,7 +416,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
return ret; return ret;
out_frame = (int16_t*) frame->data[0]; out_frame = (int16_t*) frame->data[0];
if (buf_size % 10 == 0) { if (buf_size && buf_size % 10 == 0) {
packet_type = FORMAT_G729_8K; packet_type = FORMAT_G729_8K;
format = &format_g729_8k; format = &format_g729_8k;
//Reset voice decision //Reset voice decision
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment