Introduced when I added error handling
CID 185565
for (i = 0; i < maph * mapw; ++i) {
if (map[i] < 0) {
i_push_errorf(0, "errdiff_map values must be non-negative, errdiff[%d] is negative", i);
- return 0;
+ goto fail;
}
difftotal += map[i];
}
if (!difftotal) {
i_push_error(0, "error diffusion map must contain some non-zero values");
- return 0;
+ goto fail;
}
errw = img->xsize+mapw;
myfree(err);
return 1;
+
+ fail:
+ CF_CLEANUP;
+
+ return 0;
}
/* Prescan finds the boxes in the image that have the highest number of colors
and that result is used as the initial value for the vectores */