[FFmpeg-cvslog] avcodec/hnm4video: check that packetsize is at least 8

Michael Niedermayer git at videolan.org
Fri Nov 22 17:08:39 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Nov 22 16:37:50 2013 +0100| [ba992711f79ccfba4ff0b305215d7056faf0ed0d] | committer: Michael Niedermayer

avcodec/hnm4video: check that packetsize is at least 8

Fixes integer overflow and assertion failure
Fixes: signal_sigabrt_7ffff7126425_1243_CASSE.HNM

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/hnm4video.c b/libavcodec/hnm4video.c
index 1e3c0fd..d2c4ce3 100644
--- a/libavcodec/hnm4video.c
+++ b/libavcodec/hnm4video.c
@@ -359,6 +359,11 @@ static int hnm_decode_frame(AVCodecContext *avctx, void *data,
     int ret;
     uint16_t chunk_id;
 
+    if (avpkt->size < 8) {
+        av_log(avctx, AV_LOG_ERROR, "packet too small\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
         return ret;
 



More information about the ffmpeg-cvslog mailing list