Browse code

avcodec/rv10: revert hunk from ce9f5b13ed1eb1882479574c12af24cf0e2b8aaf

Fixes segfault
Fixes: signal_sigsegv_103f872_2759_RVTR_behere_ivideo_motor_cross_interview_final_56kbps.rm

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2013/11/23 03:30:33
Showing 1 changed files
... ...
@@ -364,6 +364,8 @@ static int rv20_decode_picture_header(RVDecContext *rv)
364 364
             AVRational old_aspect = s->avctx->sample_aspect_ratio;
365 365
             av_log(s->avctx, AV_LOG_DEBUG,
366 366
                    "attempting to change resolution to %dx%d\n", new_w, new_h);
367
+            if (av_image_check_size(new_w, new_h, 0, s->avctx) < 0)
368
+                return AVERROR_INVALIDDATA;
367 369
             ff_MPV_common_end(s);
368 370
 
369 371
             // attempt to keep aspect during typical resolution switches