[FFmpeg-cvslog] avresample: Make sure the even check does not overflow

Luca Barbato git at videolan.org
Sat Oct 18 22:53:31 CEST 2014


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Wed Oct 15 17:32:57 2014 +0100| [963f76144897d3f7684d82ec21e51dd50ea1106e] | committer: Vittorio Giovara

avresample: Make sure the even check does not overflow

CC: libav-stable at libav.org
Bug-Id: CID 732225

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

 libavresample/audio_mix_matrix.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavresample/audio_mix_matrix.c b/libavresample/audio_mix_matrix.c
index 487869b..5182ae1 100644
--- a/libavresample/audio_mix_matrix.c
+++ b/libavresample/audio_mix_matrix.c
@@ -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)



More information about the ffmpeg-cvslog mailing list