summaryrefslogtreecommitdiff
path: root/libavcodec/rv10.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-04-09 20:33:25 +0200
committerAnton Khirnov <anton@khirnov.net>2013-04-17 11:01:52 +0200
commit01d376f598fe95478036f5d1e3e5e14ffe32d4bf (patch)
treec4ac306f3a04d7ffee15181bed1c2a0a946d6df9 /libavcodec/rv10.c
parentbac8d38c0a716c8bdfdecf0ae545015c68f5df36 (diff)
rv10: check that extradata is large enough
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC:libav-stable@libav.org
Diffstat (limited to 'libavcodec/rv10.c')
-rw-r--r--libavcodec/rv10.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index 789847da82..e4003a3ffb 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -346,6 +346,11 @@ static int rv20_decode_picture_header(RVDecContext *rv)
f = get_bits(&s->gb, rpr_bits);
if (f) {
+ if (s->avctx->extradata_size < 8 + 2 * f) {
+ av_log(s->avctx, AV_LOG_ERROR, "Extradata too small.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
new_w = 4 * ((uint8_t*)s->avctx->extradata)[6 + 2 * f];
new_h = 4 * ((uint8_t*)s->avctx->extradata)[7 + 2 * f];
} else {