diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2022-02-21 18:48:59 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2022-02-21 18:48:59 +0000 |
commit | 696b29ffeb71d77f9ede7dd19408cf713923684a (patch) | |
tree | 30df8d8b8cb758a48d162a622d36c242392c7951 /src/libnsgif.c | |
parent | 152c4a7429d9364ab163997dd6304665f5baa2e5 (diff) | |
download | libnsgif-696b29ffeb71d77f9ede7dd19408cf713923684a.tar.gz libnsgif-696b29ffeb71d77f9ede7dd19408cf713923684a.tar.bz2 |
gif: Background restoration: Add support for clipped frames.
Diffstat (limited to 'src/libnsgif.c')
-rw-r--r-- | src/libnsgif.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libnsgif.c b/src/libnsgif.c index 2a5ff8d..2b53492 100644 --- a/src/libnsgif.c +++ b/src/libnsgif.c @@ -549,7 +549,10 @@ static void gif__restore_bg( uint32_t width = frame->redraw_width; uint32_t height = frame->redraw_height; - if (frame->display == false) { + width -= gif__clip(offset_x, width, gif->width); + height -= gif__clip(offset_y, height, gif->height); + + if (frame->display == false || width == 0) { return; } |