Revert "fix: out-of-bounds access when bg not in color map"

with this patch certain gif images will fail to play. one other problem
here is that it suddenly breaks the loop without free-ing data and rows,
leading to a memory leak.

regardless, this needs to be investigated further.

here's an example image where this happens:
https://i.postimg.cc/SQf1TJJg/awoo-study.gif

This reverts commit cca7834e67.
pull/178/head
NRK 3 years ago committed by N-R-K
parent 0639047dde
commit ca7368aa89

@ -203,10 +203,6 @@ static bool img_load_gif(img_t *img, const fileinfo_t *file)
ptr = data = emalloc(sw * sh * sizeof(DATA32));
cmap = gif->Image.ColorMap ? gif->Image.ColorMap : gif->SColorMap;
if (bg >= cmap->ColorCount) {
err = true;
break;
}
r = cmap->Colors[bg].Red;
g = cmap->Colors[bg].Green;
b = cmap->Colors[bg].Blue;

Loading…
Cancel
Save