Skip to content

Commit

Permalink
ensure colors from both sides of difference are taken
Browse files Browse the repository at this point in the history
  • Loading branch information
liamwhite committed Jun 22, 2020
1 parent 8164b9e commit bbfa9a5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libavfilter/vf_palettegen.c
Expand Up @@ -444,9 +444,17 @@ static int update_histogram_diff(struct hist_node *hist,
for (x = 0; x < f1->width; x++) {
if (p[x] == q[x])
continue;

ret = color_inc(hist, p[x]);
if (ret < 0)
return ret;

nb_diff_colors += ret;

ret = color_inc(hist, q[x]);
if (ret < 0)
return ret;

nb_diff_colors += ret;
}
}
Expand Down

0 comments on commit bbfa9a5

Please sign in to comment.