From abc5ac3cf5176189f43062f6a3e29fd012134613 Mon Sep 17 00:00:00 2001 From: Tomas Härdin Date: Wed, 16 Jan 2019 13:07:48 +0100 Subject: palettegen: Fill with last color, not black If we fill with black then the generated palette will have one color more than what the user requested. This also resulted in unwanted black specks in the output of paletteuse, especially when generating small palettes. --- libavfilter/vf_palettegen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavfilter') diff --git a/libavfilter/vf_palettegen.c b/libavfilter/vf_palettegen.c index 5ff73e6b2b..44323782d2 100644 --- a/libavfilter/vf_palettegen.c +++ b/libavfilter/vf_palettegen.c @@ -245,7 +245,7 @@ static void write_palette(AVFilterContext *ctx, AVFrame *out) av_log(ctx, AV_LOG_WARNING, "Dupped color: %08"PRIX32"\n", pal[x]); last_color = pal[x]; } else { - pal[x] = 0xff000000; // pad with black + pal[x] = last_color; // pad with last color } } pal += pal_linesize; -- cgit v1.2.3