summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPierre Joye <pierre.php@gmail.com>2021-08-31 18:48:20 +0700
committerGitHub <noreply@github.com>2021-08-31 18:48:20 +0700
commit9251cd60d0414027b634090d3ccc4bc846fb8eef (patch)
treede8e37b0529edf440c254085acdcc92236df4fee /src
parentdeb696dbef8389f75c2924df85b7a3dac56fbe29 (diff)
parent4cd5542152afa8409e688297164a08bf03440197 (diff)
downloadlibgd-9251cd60d0414027b634090d3ccc4bc846fb8eef.tar.gz
Merge pull request #736 from libgd/bug/415
Fix #415, Assuming TopOfs and LeftOfs zero, we can safely skip any (x…
Diffstat (limited to 'src')
-rw-r--r--src/gd_gif_out.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gd_gif_out.c b/src/gd_gif_out.c
index f1d73fd..526a221 100644
--- a/src/gd_gif_out.c
+++ b/src/gd_gif_out.c
@@ -745,6 +745,8 @@ break_top:
/* Then the bottom row */
for (y = tim->sy - 1; y > min_y; --y) {
for (x = 0; x < tim->sx; ++x) {
+ if (!gdImageBoundsSafe(prev_tim, x,y))
+ continue;
if (!comparewithmap
(prev_tim, tim,
prev_tim->pixels[y][x],
@@ -766,6 +768,8 @@ break_bot:
/* left side */
for (x = 0; x < min_x; ++x) {
for (y = min_y; y <= max_y; ++y) {
+ if (!gdImageBoundsSafe(prev_tim, x,y))
+ continue;
if (!comparewithmap
(prev_tim, tim,
prev_tim->pixels[y][x],
@@ -781,6 +785,8 @@ break_left:
/* right side */
for (x = tim->sx - 1; x > max_x; --x) {
for (y = min_y; y <= max_y; ++y) {
+ if (!gdImageBoundsSafe(prev_tim, x,y))
+ continue;
if (!comparewithmap
(prev_tim, tim,
prev_tim->pixels[y][x],