Mercurial > libavcodec.hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
2421:e326490f58c4 | 2422:18b8b2dcc037 |
---|---|
72 p= s->avctx->stats_in; | 72 p= s->avctx->stats_in; |
73 for(i=-1; p; i++){ | 73 for(i=-1; p; i++){ |
74 p= strchr(p+1, ';'); | 74 p= strchr(p+1, ';'); |
75 } | 75 } |
76 i+= s->max_b_frames; | 76 i+= s->max_b_frames; |
77 if(i<=0 || i>=INT_MAX / sizeof(RateControlEntry)) | |
78 return -1; | |
77 rcc->entry = (RateControlEntry*)av_mallocz(i*sizeof(RateControlEntry)); | 79 rcc->entry = (RateControlEntry*)av_mallocz(i*sizeof(RateControlEntry)); |
78 rcc->num_entries= i; | 80 rcc->num_entries= i; |
79 | 81 |
80 /* init all to skiped p frames (with b frames we might have a not encoded frame at the end FIXME) */ | 82 /* init all to skiped p frames (with b frames we might have a not encoded frame at the end FIXME) */ |
81 for(i=0; i<rcc->num_entries; i++){ | 83 for(i=0; i<rcc->num_entries; i++){ |