Skip to content

Commit

Permalink
Exactly zero weight on all pixels caused spurious failure
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Jan 27, 2021
1 parent 4e450f7 commit 79afd3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pam.c
Expand Up @@ -178,7 +178,7 @@ LIQ_PRIVATE struct acolorhash_table *pam_allocacolorhash(unsigned int maxcolors,

ALWAYS_INLINE static float pam_add_to_hist(const float *gamma_lut, hist_item *achv, unsigned int *j, const struct acolorhist_arr_item *entry, const float max_perceptual_weight)
{
if (entry->perceptual_weight == 0) {
if (entry->perceptual_weight == 0 && *j > 0) {
return 0;
}
const float w = MIN(entry->perceptual_weight/128.f, max_perceptual_weight);
Expand Down

0 comments on commit 79afd3a

Please sign in to comment.