aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2021-11-17 05:46:02 +0600
committerN-R-K <79544946+N-R-K@users.noreply.github.com>2021-11-26 15:36:05 +0600
commitca7368aa8960ee6b7094b997dcc71ffb5b1e310f (patch)
tree25f32cc4c7d2419417e7df5cd51f5438cb92e4e1
parent0639047dde5d3ccb35f9c1a7be3266a373945b6e (diff)
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.
-rw-r--r--image.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/image.c b/image.c
index 9a47a14..980bf1a 100644
--- a/image.c
+++ b/image.c
@@ -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;