summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2022-02-27 12:02:14 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2022-02-27 12:02:14 +0000
commit464bec1bbec32978a41b0a0f011711df428117c3 (patch)
tree8362dfc93cc8916a67ccc462415e4433a5df1175
parent41d8bcf828af44c775454e46ce751f9ac1a3684e (diff)
downloadlibnsgif-464bec1bbec32978a41b0a0f011711df428117c3.tar.gz
libnsgif-464bec1bbec32978a41b0a0f011711df428117c3.tar.bz2
Docs: Add note about source data lifetime to README.
-rw-r--r--README.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/README.md b/README.md
index d821ac6..cb380c3 100644
--- a/README.md
+++ b/README.md
@@ -54,6 +54,11 @@ function has returned `NSGIF_OK` it has enough data to display at least one
frame. The early frames can be decoded before the later frames are scanned.
Frames have to be scanned before they can be decoded.
+> **Note**: The client must not free the data until after calling
+> `nsgif_destroy()`. You can move the data, e.g. if you realloc to a bigger
+> buffer. Just be sure to call `nsgif_data_scan()` again with the new pointer
+> before making any other calls against that nsgif object.
+
To decode the frames, you can call `nsgif_get_info()` to get the frame_count,
and then call `nsgif_frame_decode()` for each frame, and manage the animation,
and non-displayable frames yourself, or you can use the helper function,