summaryrefslogtreecommitdiff
path: root/libavcodec/libopencore-amr.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-24 18:26:54 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-24 18:26:54 +0100
commit34b6f1efa20694eab6268197e788a3c1a5cb2a3b (patch)
tree7065acc427a39fa3423bac355d094f9388161276 /libavcodec/libopencore-amr.c
parent57c0da6fe4ebd7c2d58a28248d84a18d45fce0ee (diff)
downloadffmpeg-34b6f1efa20694eab6268197e788a3c1a5cb2a3b.tar.gz
libopencore_amrwb: check packet size
Fix OOM Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libopencore-amr.c')
-rw-r--r--libavcodec/libopencore-amr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c
index efe87cd0fa..f0207aed8d 100644
--- a/libavcodec/libopencore-amr.c
+++ b/libavcodec/libopencore-amr.c
@@ -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);