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.
This commit is contained in:
NRK 2021-11-17 05:46:02 +06:00 committed by N-R-K
parent 0639047dde
commit ca7368aa89
1 changed files with 0 additions and 4 deletions

View File

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