avfilter/vf_delogo: make the interp value compute method simple
authorSteven Liu <lq@chinaffmpeg.org>
Tue, 8 Oct 2019 03:45:33 +0000 (11:45 +0800)
committerSteven Liu <lq@chinaffmpeg.org>
Thu, 10 Oct 2019 02:27:00 +0000 (10:27 +0800)
because the interp >= 0UL comparison of an unsigned value is always true
fix CID: 1454642

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
libavfilter/vf_delogo.c

index 9c58418..a5692b0 100644 (file)
@@ -168,7 +168,7 @@ static void apply_delogo(uint8_t *dst, int dst_linesize,
                  botleft[x-logo_x1-1]  +
                  botleft[x-logo_x1+1]) * weightb;
             weight = (weightl + weightr + weightt + weightb) * 3U;
-            interp = ROUNDED_DIV(interp, weight);
+            interp = (interp + (weight >> 1)) / weight;
 
             if (y >= logo_y+band && y < logo_y+logo_h-band &&
                 x >= logo_x+band && x < logo_x+logo_w-band) {