aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-16 15:40:57 +0300
committerLuca Barbato <lu_zero@gentoo.org>2014-01-07 09:43:56 +0100
commit3b169044ca042f1bc82a7e55bbf72062b051c75f (patch)
tree1b186c17c93d0ed9e3a5e1711362310d93253a5d
parent0a23055b8ab24800774a7079921791acb92fe0f2 (diff)
downloadffmpeg-3b169044ca042f1bc82a7e55bbf72062b051c75f.tar.gz
rv10: Validate the dimensions set from the container
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 5372cda67109848d22146289e401669266217e80) Signed-off-by: Luca Barbato <lu_zero@gentoo.org> (cherry picked from commit 0b0f1cd44ece180e12795cfc8d0a0ac5ea3ebe2c)
-rw-r--r--libavcodec/rv10.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index 4f64ec29b3..59bd96859e 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -425,12 +425,15 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx)
{
MpegEncContext *s = avctx->priv_data;
static int done=0;
- int major_ver, minor_ver, micro_ver;
+ int major_ver, minor_ver, micro_ver, ret;
if (avctx->extradata_size < 8) {
av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n");
return -1;
}
+ if ((ret = av_image_check_size(avctx->coded_width,
+ avctx->coded_height, 0, avctx)) < 0)
+ return ret;
MPV_decode_defaults(s);