diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index a802e1e4ace4b44389342745d281e14600aaf667..07b7de1208f2aff26061ed5fcc28d0456655373f 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -2242,7 +2242,7 @@ static void hls_decode_neighbour(HEVCContext *s, int x_ctb, int y_ctb,
         if (y_ctb > 0 && s->tab_slice_address[ctb_addr_rs] != s->tab_slice_address[ctb_addr_rs - s->ps.sps->ctb_width])
             lc->boundary_flags |= BOUNDARY_UPPER_SLICE;
     } else {
-        if (!ctb_addr_in_slice > 0)
+        if (!ctb_addr_in_slice)
             lc->boundary_flags |= BOUNDARY_LEFT_SLICE;
         if (ctb_addr_in_slice < s->ps.sps->ctb_width)
             lc->boundary_flags |= BOUNDARY_UPPER_SLICE;