# HG changeset patch # User michael # Date 1211931670 0 # Node ID 224b51e2c96083a496e9cec849e3004cedbbe455 # Parent e716466d366510c327763464a143ced6b21a2ff5 Check dia size a little more. Fixes CID80. diff -r e716466d3665 -r 224b51e2c960 motion_est.c --- a/motion_est.c Tue May 27 22:10:17 2008 +0000 +++ b/motion_est.c Tue May 27 23:41:10 2008 +0000 @@ -235,6 +235,12 @@ MotionEstContext * const c= &s->me; int cache_size= FFMIN(ME_MAP_SIZE>>ME_MAP_SHIFT, 1<avctx->dia_size)&255, FFABS(s->avctx->pre_dia_size)&255); + + if(FFMIN(s->avctx->dia_size, s->avctx->pre_dia_size) < -ME_MAP_SIZE){ + av_log(s->avctx, AV_LOG_ERROR, "ME_MAP size is too small for SAB diamond\n"); + return -1; + } + c->avctx= s->avctx; if(cache_size < 2*dia_size && !c->stride){