summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2022-05-08 16:17:58 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2022-05-08 16:17:58 +0100
commit5a1c0ed3ba4534957965839fda659482603117e2 (patch)
treee01dc752da32a7174b163205f9bd26686392ffca
parent50b3f3b46903281c5507786b5f65118dca5139a5 (diff)
downloadlibnsgif-5a1c0ed3ba4534957965839fda659482603117e2.tar.gz
libnsgif-5a1c0ed3ba4534957965839fda659482603117e2.tar.bz2
GIF: Store frame palette offset.
-rw-r--r--src/gif.c7
1 files changed, 7 insertions, 0 deletions
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),