From 75ed38539447571ec961c985c8a1e9cbd76573e2 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Fri, 15 Apr 2022 16:41:19 +0100 Subject: GIF: Ensure frame clipping is applied to max lzw output length. --- src/gif.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gif.c b/src/gif.c index aeb70f2..84d4209 100644 --- a/src/gif.c +++ b/src/gif.c @@ -525,7 +525,7 @@ static nsgif_error nsgif__decode_simple( uint32_t *restrict frame_data, uint32_t *restrict colour_table) { - uint32_t pixels = gif->info.width * height; + uint32_t pixels; uint32_t written = 0; nsgif_error ret = NSGIF_OK; lzw_result res; @@ -550,6 +550,7 @@ static nsgif_error nsgif__decode_simple( } frame_data += (offset_y * gif->info.width); + pixels = gif->info.width * height; while (pixels > 0) { res = lzw_decode_map(gif->lzw_ctx, -- cgit v1.2.1