From eb1860e0174df1e55fce09084421847a1847424a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Thu, 9 Aug 2018 19:22:02 +0200 Subject: [PATCH] lavfi/selectivecolor: fix neutral color filtering Neutrals are supposed to be anything not black (0,0,0) and not white (N,N,N). Previous neutral filtering code was too strict by excluding colors with any of its RGB component maxed instead of just the white color. Reported-by: Royi Avital --- libavfilter/vf_selectivecolor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_selectivecolor.c b/libavfilter/vf_selectivecolor.c index c4d51bb70d..b99f31bef2 100644 --- a/libavfilter/vf_selectivecolor.c +++ b/libavfilter/vf_selectivecolor.c @@ -344,7 +344,7 @@ static inline int selective_color_##nbits(AVFilterContext *ctx, ThreadData *td, const int max_color = FFMAX3(r, g, b); \ const int is_white = (r > 1<<(nbits-1) && g > 1<<(nbits-1) && b > 1<<(nbits-1)); \ const int is_neutral = (r || g || b) && \ - r != (1<