From 5a1c0ed3ba4534957965839fda659482603117e2 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 8 May 2022 16:17:58 +0100 Subject: GIF: Store frame palette offset. --- src/gif.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gif.c b/src/gif.c index e9048f9..7f960d1 100644 --- a/src/gif.c +++ b/src/gif.c @@ -43,6 +43,9 @@ typedef struct nsgif_frame { /** the index designating a transparent pixel */ uint32_t transparency_index; + /** offset to frame colour table */ + uint32_t colour_table_offset; + /* Frame flags */ uint32_t flags; } nsgif_frame; @@ -1130,6 +1133,10 @@ static nsgif_error nsgif__parse_colour_table( return NSGIF_OK; } + if (decode == false) { + frame->colour_table_offset = *pos - gif->buf; + } + ret = nsgif__colour_table_extract( gif->local_colour_table, &gif->colour_layout, 2 << (frame->flags & NSGIF_COLOUR_TABLE_SIZE_MASK), -- cgit v1.2.1