motion_est_template: Fix undefined left shift of negative number
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>
Sat, 26 Sep 2015 14:24:01 +0000 (16:24 +0200)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Tue, 29 Sep 2015 12:33:00 +0000 (14:33 +0200)
This fixes a -Wshift-negative-value warning reported with clang 3.7+.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
libavcodec/motion_est_template.c

index 01936c6..33f3dcb 100644 (file)
@@ -704,7 +704,8 @@ static int sab_diamond_search(MpegEncContext * s, int *best, int dmin,
 
         key += (1<<(ME_MAP_MV_BITS-1)) + (1<<(2*ME_MAP_MV_BITS-1));
 
-        if((key&((-1)<<(2*ME_MAP_MV_BITS))) != map_generation) continue;
+        if ((key & (-(1 << (2 * ME_MAP_MV_BITS)))) != map_generation)
+            continue;
 
         minima[j].height= score_map[i];
         minima[j].x= key & ((1<<ME_MAP_MV_BITS)-1); key>>=ME_MAP_MV_BITS;