diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c index a8defc7582..87a90d0a35 100644 --- a/libavfilter/vf_paletteuse.c +++ b/libavfilter/vf_paletteuse.c @@ -133,9 +133,9 @@ static int query_formats(AVFilterContext *ctx) static av_always_inline int dither_color(uint32_t px, int er, int eg, int eb, int scale, int shift) { - return av_clip_uint8((px >> 16 & 0xff) + ((er * scale) >> shift)) << 16 - | av_clip_uint8((px >> 8 & 0xff) + ((eg * scale) >> shift)) << 8 - | av_clip_uint8((px & 0xff) + ((eb * scale) >> shift)); + return av_clip_uint8((px >> 16 & 0xff) + ((er * scale) / (1<> 8 & 0xff) + ((eg * scale) / (1<