[FFmpeg-devel] [PATCH]Avoid a null pointer dereference on oom when decoding rv40

Carl Eugen Hoyos cehoyos at ag.or.at
Sun Jul 7 23:20:18 CEST 2013


Hi!

Attached patch fixes ticket #2727 here, the same patch also applies to rv30.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c
index d6dfc5e..17574ee 100644
--- a/libavcodec/rv40.c
+++ b/libavcodec/rv40.c
@@ -547,9 +547,12 @@ static void rv40_loop_filter(RV34DecContext *r, int row)
 static av_cold int rv40_decode_init(AVCodecContext *avctx)
 {
     RV34DecContext *r = avctx->priv_data;
+    int ret;
 
     r->rv30 = 0;
-    ff_rv34_decode_init(avctx);
+    ret = ff_rv34_decode_init(avctx);
+    if (ret < 0)
+        return ret;
     if(!aic_top_vlc.bits)
         rv40_init_tables();
     r->parse_slice_header = rv40_parse_slice_header;


More information about the ffmpeg-devel mailing list