summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2022-03-03 19:10:01 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2022-03-03 19:15:28 +0000
commitd8bd0736b06045ff7591e4db27cf4cd8a6ca929b (patch)
treed82e978512bebe7fa3b52b2b81ba11406285db75 /src
parent030c31ccd5287813cdd60ff299a577a36900fdda (diff)
downloadlibnsgif-d8bd0736b06045ff7591e4db27cf4cd8a6ca929b.tar.gz
libnsgif-d8bd0736b06045ff7591e4db27cf4cd8a6ca929b.tar.bz2
GIF: Fix frame limit off-by-one.
Diffstat (limited to 'src')
-rw-r--r--src/gif.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gif.c b/src/gif.c
index d4d708f..637d0ae 100644
--- a/src/gif.c
+++ b/src/gif.c
@@ -1703,7 +1703,7 @@ nsgif_error nsgif_frame_decode(
uint32_t start_frame;
nsgif_error ret = NSGIF_OK;
- if (frame > gif->info.frame_count) {
+ if (frame >= gif->info.frame_count) {
return NSGIF_ERR_BAD_FRAME;
}
@@ -1742,7 +1742,7 @@ const nsgif_frame_info_t *nsgif_get_frame_info(
const nsgif_t *gif,
uint32_t frame)
{
- if (frame > gif->info.frame_count) {
+ if (frame >= gif->info.frame_count) {
return NULL;
}