Skip to content

Commit

Permalink
only restore background when dispose is 2 or 3
Browse files Browse the repository at this point in the history
Signed-off-by: Cocoa <[email protected]>
  • Loading branch information
cocoa-xu committed Oct 8, 2024
1 parent ae721c5 commit 7a14f3b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions stb_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -6829,8 +6829,10 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i
// 0: not specified.
}

// background is what out is after the undoing of the previou frame;
memcpy( g->background, g->out, 4 * g->w * g->h );
if (dispose == 2 || dispose == 3) {
// background is what out is after the undoing of the previou frame;
memcpy( g->background, g->out, 4 * g->w * g->h );
}
}

// clear my history;
Expand Down

0 comments on commit 7a14f3b

Please sign in to comment.