diff ratecontrol.c @ 2422:18b8b2dcc037 libavcodec

various security fixes and precautionary checks
author michael
date Wed, 12 Jan 2005 00:16:25 +0000
parents 2721e1859e19
children 87b7fbed8609
line wrap: on
line diff
--- a/ratecontrol.c	Tue Jan 11 08:16:04 2005 +0000
+++ b/ratecontrol.c	Wed Jan 12 00:16:25 2005 +0000
@@ -74,6 +74,8 @@
             p= strchr(p+1, ';');
         }
         i+= s->max_b_frames;
+        if(i<=0 || i>=INT_MAX / sizeof(RateControlEntry))
+            return -1;
         rcc->entry = (RateControlEntry*)av_mallocz(i*sizeof(RateControlEntry));
         rcc->num_entries= i;