[FFmpeg-cvslog] libopencore_amrwb: check packet size
Michael Niedermayer
git at videolan.org
Sat Nov 24 18:39:52 CET 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Nov 24 18:26:54 2012 +0100| [34b6f1efa20694eab6268197e788a3c1a5cb2a3b] | committer: Michael Niedermayer
libopencore_amrwb: check packet size
Fix OOM
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=34b6f1efa20694eab6268197e788a3c1a5cb2a3b
---
libavcodec/libopencore-amr.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c
index efe87cd..f0207ae 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);
More information about the ffmpeg-cvslog
mailing list