From cecdd73db786c2ea29f9d6eff1d30f1e8b75eeb5 Mon Sep 17 00:00:00 2001 From: Fritz Koenig Date: Thu, 24 Jun 2010 12:18:23 -0400 Subject: [PATCH] vp8cx : bestsad declared and initialized incorrectly. bestsad should be an int initialized to INT_MAX. The optimized SAD function expects a signed value for bestsad to use for comparison and early loop termination. When no match is made, which is determined by a comparison of bestsad to INT_MAX, INT_MAX is returned. --- vp8/encoder/mcomp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vp8/encoder/mcomp.c b/vp8/encoder/mcomp.c index 4c3edd7..6d69a9e 100644 --- a/vp8/encoder/mcomp.c +++ b/vp8/encoder/mcomp.c @@ -997,7 +997,7 @@ int vp8_diamond_search_sadx4 int tot_steps; MV this_mv; - unsigned int bestsad = UINT_MAX; + int bestsad = INT_MAX; int best_site = 0; int last_site = 0; -- 2.7.4