diff mpegvideo.c @ 2576:e237d9bd0f8c libavcodec

check mb/me_threshold range, fixes assertion failure
author michael
date Sat, 26 Mar 2005 18:10:44 +0000
parents 682c57163e60
children c07be5590462
line wrap: on
line diff
--- a/mpegvideo.c	Sat Mar 26 17:01:49 2005 +0000
+++ b/mpegvideo.c	Sat Mar 26 18:10:44 2005 +0000
@@ -1054,6 +1054,16 @@
         av_log(avctx, AV_LOG_ERROR, "framerate not set\n");
         return -1;
     }
+    
+    i= (INT_MAX/2+128)>>8;
+    if(avctx->me_threshold >= i){
+        av_log(avctx, AV_LOG_ERROR, "me_threshold too large, max is %d\n", i - 1);
+        return -1;
+    }
+    if(avctx->mb_threshold >= i){
+        av_log(avctx, AV_LOG_ERROR, "mb_threshold too large, max is %d\n", i - 1);
+        return -1;
+    }
         
     i= ff_gcd(avctx->frame_rate, avctx->frame_rate_base);
     if(i > 1){