1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

libopencore_amrwb: check packet size

Fix OOM

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-11-24 18:26:54 +01:00
parent 57c0da6fe4
commit 34b6f1efa2

View File

@ -359,6 +359,10 @@ static int amr_wb_decode_frame(AVCodecContext *avctx, void *data,
buf_size, packet_size + 1);
return AVERROR_INVALIDDATA;
}
if (!packet_size) {
av_log(avctx, AV_LOG_ERROR, "amr packet_size invalid\n");
return AVERROR_INVALIDDATA;
}
D_IF_decode(s->state, buf, (short *)s->frame.data[0], _good_frame);