avresample: Make sure the even check does not overflow
authorLuca Barbato <lu_zero@gentoo.org>
Wed, 15 Oct 2014 16:32:57 +0000 (17:32 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 12 Jan 2015 22:59:59 +0000 (23:59 +0100)
CC: libav-stable@libav.org
Bug-Id: CID 732225

libavresample/audio_mix_matrix.c

index 487869b..5182ae1 100644 (file)
@@ -60,7 +60,7 @@
 
 static av_always_inline int even(uint64_t layout)
 {
-    return (!layout || (layout & (layout - 1)));
+    return (!layout || !!(layout & (layout - 1)));
 }
 
 static int sane_layout(uint64_t layout)