[FFmpeg-cvslog] rv10: check that extradata is large enough

Anton Khirnov git at videolan.org
Sun May 12 13:51:26 CEST 2013


ffmpeg | branch: release/1.1 | Anton Khirnov <anton at khirnov.net> | Tue Apr  9 20:33:25 2013 +0200| [fa4192e31f4b9d3b6bf68daa5702926ae521e4ea] | committer: Reinhard Tartler

rv10: check that extradata is large enough

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable at libav.org

(cherry picked from commit 01d376f598fe95478036f5d1e3e5e14ffe32d4bf)

Conflicts:

	libavcodec/rv10.c

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

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

diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index 9239cf7..26af29f 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -347,6 +347,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{



More information about the ffmpeg-cvslog mailing list