diff options
author | Martin Storsjö <martin@martin.st> | 2013-09-20 00:07:34 +0300 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2014-01-07 09:43:57 +0100 |
commit | b29c31c21e6d9d791b413146defb1986032d72b5 (patch) | |
tree | bdefb0affe0b0e3aa6648ca956db33f01ec4b1e6 /libavcodec/wnv1.c | |
parent | 456a9392103f6ccd63173660804b1029052dc36c (diff) | |
download | ffmpeg-b29c31c21e6d9d791b413146defb1986032d72b5.tar.gz |
wnv1: Make sure the input packet is large enough
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 91be1103fd1f79d381edf268c32f4166b6c3b6d8)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 0c8c6b4419e00d13197a4aea5456b398dca24df0)
Diffstat (limited to 'libavcodec/wnv1.c')
-rw-r--r-- | libavcodec/wnv1.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c index f6e4694df2..0cc26dbb60 100644 --- a/libavcodec/wnv1.c +++ b/libavcodec/wnv1.c @@ -70,6 +70,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"); |