summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/rv10.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index 8d5b62f925..bd58dec549 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -345,6 +345,11 @@ static int rv20_decode_picture_header(MpegEncContext *s)
f= get_bits(&s->gb, av_log2(v)+1);
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{