[FFmpeg-cvslog] wnv1: Make sure the input packet is large enough

Martin Storsjö git at videolan.org
Tue Oct 8 01:33:16 CEST 2013


ffmpeg | branch: release/1.1 | Martin Storsjö <martin at martin.st> | Fri Sep 20 00:07:34 2013 +0300| [0c8c6b4419e00d13197a4aea5456b398dca24df0] | committer: Luca Barbato

wnv1: Make sure the input packet is large enough

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit 91be1103fd1f79d381edf268c32f4166b6c3b6d8)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

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

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

diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c
index 1636f16..362fafc 100644
--- a/libavcodec/wnv1.c
+++ b/libavcodec/wnv1.c
@@ -71,6 +71,11 @@ static int decode_frame(AVCodecContext *avctx,
     int prev_y = 0, prev_u = 0, prev_v = 0;
     uint8_t *rbuf;
 
+    if (buf_size < 8) {
+        av_log(avctx, AV_LOG_ERROR, "Packet is too short\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     rbuf = av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
     if (!rbuf) {
         av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");



More information about the ffmpeg-cvslog mailing list