Skip to content

Commit 7a14f3b

Browse files
committed
only restore background when dispose is 2 or 3
Signed-off-by: Cocoa <[email protected]>
1 parent ae721c5 commit 7a14f3b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

stb_image.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -6829,8 +6829,10 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i
68296829
// 0: not specified.
68306830
}
68316831

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

68366838
// clear my history;

0 commit comments

Comments
 (0)