Krolyxon
Commit ca7368a

Branches

Refs →

nsxivca7368a

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 cca7834e6718c6ff64da42ed5e9770880a3e8ff6.
Author
NRK
Date
2021-11-17 05:46 +0600
Committer
N-R-K · 2021-11-26 15:36 +0600
Parent
0639047
Commit
ca7368aa8960ee6b7094b997dcc71ffb5b1e310f

+0 −4

1 file changed

  1. M image.c +0 −4
M image.c View
@@ -203,10 +203,6 @@ static bool img_load_gif(img_t *img, const fileinfo_t *file)
203203
204204 ptr = data = emalloc(sw * sh * sizeof(DATA32));
205205 cmap = gif->Image.ColorMap ? gif->Image.ColorMap : gif->SColorMap;
206− if (bg >= cmap->ColorCount) {
207− err = true;
208− break;
209− }
210206 r = cmap->Colors[bg].Red;
211207 g = cmap->Colors[bg].Green;
212208 b = cmap->Colors[bg].Blue;