diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2022-03-03 19:06:33 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2022-03-03 19:15:28 +0000 |
commit | 81e55f826dba3b749fd20f3bbd1d42ca42494732 (patch) | |
tree | d2546a9c872f8fc2073ec206ad81e059e77cb3d0 | |
parent | d8bd0736b06045ff7591e4db27cf4cd8a6ca929b (diff) | |
download | libnsgif-81e55f826dba3b749fd20f3bbd1d42ca42494732.tar.gz libnsgif-81e55f826dba3b749fd20f3bbd1d42ca42494732.tar.bz2 |
GIF: Fix frame background colour disposal for frame clipping.
-rw-r--r-- | src/gif.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -625,13 +625,15 @@ static void nsgif__restore_bg( uint32_t offset_x = frame->info.rect.x0; uint32_t offset_y = frame->info.rect.y0; - width -= gif__clip(offset_x, width, gif->info.width); - height -= gif__clip(offset_y, height, gif->info.height); - - if (frame->info.display == false || width == 0) { + if (frame->info.display == false || + frame->info.rect.x0 >= gif->info.width || + frame->info.rect.y0 >= gif->info.height) { return; } + width -= gif__clip(offset_x, width, gif->info.width); + height -= gif__clip(offset_y, height, gif->info.height); + if (frame->info.transparency) { for (uint32_t y = 0; y < height; y++) { uint32_t *scanline = bitmap + offset_x + |