[FFmpeg-cvslog] motion_est: more complete SAB diamond size check

Michael Niedermayer git at videolan.org
Thu Oct 25 21:29:18 CEST 2012


ffmpeg | branch: release/0.10 | Michael Niedermayer <michaelni at gmx.at> | Fri Oct 12 19:33:39 2012 +0200| [f2d56c2eebe6412c21f7376aaabdeedb91f61875] | committer: Michael Niedermayer

motion_est: more complete SAB diamond size check

This makes no difference with the current #defines

Fixes CID732255
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 3a48e38ad0e37d89065843548414d367e70593bf)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f2d56c2eebe6412c21f7376aaabdeedb91f61875
---

 libavcodec/motion_est.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index ad63952..0b8c4f4 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -300,7 +300,7 @@ int ff_init_me(MpegEncContext *s){
     int cache_size= FFMIN(ME_MAP_SIZE>>ME_MAP_SHIFT, 1<<ME_MAP_SHIFT);
     int dia_size= FFMAX(FFABS(s->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){
+    if(FFMIN(s->avctx->dia_size, s->avctx->pre_dia_size) < -FFMIN(ME_MAP_SIZE, MAX_SAB_SIZE)){
         av_log(s->avctx, AV_LOG_ERROR, "ME_MAP size is too small for SAB diamond\n");
         return -1;
     }



More information about the ffmpeg-cvslog mailing list