colorcnt += octt_add(ct, samp[x], samp[x+1], samp[x+2]);
x += 3;
if (colorcnt > maxc) {
- octt_delete(ct);
+ octt_delete(ct);
+ myfree(samp);
return -1;
}
}
/* JPEG 2000
This might match a little loosely */
FORMAT_ENTRY("\x00\x00\x00\x0CjP \x0D\x0A\x87\x0A", "jp2"),
+
+ /* FLIF - Free Lossless Image Format - https://flif.info/spec.html */
+ FORMAT_ENTRY("FLIF", "flif")
};
static const struct magic_entry more_formats[] = {
/* these were originally both listed as ico, but cur files can
if (im->type == i_palette_type
&& i_colorcount(im) == 2) {
i_color colors[2];
- i_getcolors(im, 0, colors, 2);
+ if (!i_getcolors(im, 0, colors, 2))
+ return 0;
if (im->channels == 3) {
if (colors[0].rgb.r == 255 &&
colors[0].rgb.g == 255 &&