Fix OOM
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
... | ... |
@@ -359,6 +359,10 @@ static int amr_wb_decode_frame(AVCodecContext *avctx, void *data, |
359 | 359 |
buf_size, packet_size + 1); |
360 | 360 |
return AVERROR_INVALIDDATA; |
361 | 361 |
} |
362 |
+ if (!packet_size) { |
|
363 |
+ av_log(avctx, AV_LOG_ERROR, "amr packet_size invalid\n"); |
|
364 |
+ return AVERROR_INVALIDDATA; |
|
365 |
+ } |
|
362 | 366 |
|
363 | 367 |
D_IF_decode(s->state, buf, (short *)s->frame.data[0], _good_frame); |
364 | 368 |
|