[FFmpeg-cvslog] adpcmdec: Fix OOM/infloop

Michael Niedermayer git at videolan.org
Sat Nov 24 19:29:48 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Nov 24 19:17:23 2012 +0100| [807fa714f05c584ac027c36841315cea98f329d3] | committer: Michael Niedermayer

adpcmdec: Fix OOM/infloop

Found-by: ami_stuff
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=807fa714f05c584ac027c36841315cea98f329d3
---

 libavcodec/adpcm.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index d8bbdbb..3249522 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -1355,6 +1355,11 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
         return -1;
     }
 
+    if (avpkt->size && bytestream2_tell(&gb) == 0) {
+        av_log(avctx, AV_LOG_ERROR, "Nothing consumed\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     *got_frame_ptr   = 1;
     *(AVFrame *)data = c->frame;
 



More information about the ffmpeg-cvslog mailing list