Do not decode RV30 files if the extradata is too small
authorRafaël Carré <rafael.carre@gmail.com>
Sat, 16 Jul 2011 15:41:08 +0000 (11:41 -0400)
committerReinhard Tartler <siretart@tauware.de>
Mon, 26 Sep 2011 17:26:29 +0000 (19:26 +0200)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit 289c60001fb0a9a1d7a97c876d8a42b84c6874ac)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/rv30.c

index 62177dd..2b423cc 100644 (file)
@@ -256,6 +256,7 @@ static av_cold int rv30_decode_init(AVCodecContext *avctx)
     if(avctx->extradata_size - 8 < (r->rpr - 1) * 2){
         av_log(avctx, AV_LOG_ERROR, "Insufficient extradata - need at least %d bytes, got %d\n",
                6 + r->rpr * 2, avctx->extradata_size);
+        return EINVAL;
     }
     r->parse_slice_header = rv30_parse_slice_header;
     r->decode_intra_types = rv30_decode_intra_types;