From 1c3873f5b2aabd4a77ce2acbae7db034443b1c04 Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Mon, 4 May 2015 17:11:11 +0300 Subject: [PATCH] Fix coverity warning. - Overflow from buggy implementation of modulo behavior for pattern_type. As there is no need for such behavior I removed it. --- src/search.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/search.c b/src/search.c index b581d16e..90ff6bf3 100644 --- a/src/search.c +++ b/src/search.c @@ -218,6 +218,8 @@ unsigned tz_pattern_search(const encoder_state_t * const state, const image_t *p vector2d_t mv_best = { 0, 0 }; + assert(pattern_type < 4); + //implemented search patterns vector2d_t pattern[4][8] = { //diamond (8 points) @@ -282,12 +284,6 @@ unsigned tz_pattern_search(const encoder_state_t * const state, const image_t *p }; - //make sure parameter pattern_type is within correct range - if (pattern_type > sizeof pattern - 1) - { - pattern_type = sizeof pattern - 1; - } - //set the number of points to be checked if (iDist == 1) {