diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
index a0fbecc9911143455c0bea678476957a231ed13e..a843e318c485766e087228255ab4c820611e8c69 100644
--- a/libavformat/mov_chan.c
+++ b/libavformat/mov_chan.c
@@ -492,7 +492,7 @@ uint32_t ff_mov_get_channel_layout_tag(enum CodecID codec_id,
 
         /* find the layout tag for the specified channel layout */
         for (i = 0; layouts[i] != 0; i++) {
-            if (layouts[i] & 0xFFFF != channels)
+            if ((layouts[i] & 0xFFFF) != channels)
                 continue;
             for (j = 0; layout_map[j].tag != 0; j++) {
                 if (layout_map[j].tag    == layouts[i] &&