Mercurial > libavcodec.hg
comparison motion_est.c @ 6914:224b51e2c960 libavcodec
Check dia size a little more. Fixes CID80.
author | michael |
---|---|
date | Tue, 27 May 2008 23:41:10 +0000 |
parents | 493dc59d469a |
children | 167bd4bec8d1 |
comparison
equal
deleted
inserted
replaced
6913:e716466d3665 | 6914:224b51e2c960 |
---|---|
233 | 233 |
234 void ff_init_me(MpegEncContext *s){ | 234 void ff_init_me(MpegEncContext *s){ |
235 MotionEstContext * const c= &s->me; | 235 MotionEstContext * const c= &s->me; |
236 int cache_size= FFMIN(ME_MAP_SIZE>>ME_MAP_SHIFT, 1<<ME_MAP_SHIFT); | 236 int cache_size= FFMIN(ME_MAP_SIZE>>ME_MAP_SHIFT, 1<<ME_MAP_SHIFT); |
237 int dia_size= FFMAX(FFABS(s->avctx->dia_size)&255, FFABS(s->avctx->pre_dia_size)&255); | 237 int dia_size= FFMAX(FFABS(s->avctx->dia_size)&255, FFABS(s->avctx->pre_dia_size)&255); |
238 | |
239 if(FFMIN(s->avctx->dia_size, s->avctx->pre_dia_size) < -ME_MAP_SIZE){ | |
240 av_log(s->avctx, AV_LOG_ERROR, "ME_MAP size is too small for SAB diamond\n"); | |
241 return -1; | |
242 } | |
243 | |
238 c->avctx= s->avctx; | 244 c->avctx= s->avctx; |
239 | 245 |
240 if(cache_size < 2*dia_size && !c->stride){ | 246 if(cache_size < 2*dia_size && !c->stride){ |
241 av_log(s->avctx, AV_LOG_INFO, "ME_MAP size may be a little small for the selected diamond size\n"); | 247 av_log(s->avctx, AV_LOG_INFO, "ME_MAP size may be a little small for the selected diamond size\n"); |
242 } | 248 } |