Skip to content

Commit ff74b42

Browse files
committed
only restore background when dispose is 3
Signed-off-by: Cocoa <i@uwucocoa.moe>
1 parent ae721c5 commit ff74b42

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stb_image.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -6815,6 +6815,9 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i
68156815
memcpy( &g->out[pi * 4], &two_back[pi * 4], 4 );
68166816
}
68176817
}
6818+
6819+
// background is what out is after the undoing of the previou frame;
6820+
memcpy( g->background, g->out, 4 * g->w * g->h );
68186821
} else if (dispose == 2) {
68196822
// restore what was changed last frame to background before that frame;
68206823
for (pi = 0; pi < pcount; ++pi) {
@@ -6828,9 +6831,6 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i
68286831
// 1: do not dispose
68296832
// 0: not specified.
68306833
}
6831-
6832-
// background is what out is after the undoing of the previou frame;
6833-
memcpy( g->background, g->out, 4 * g->w * g->h );
68346834
}
68356835

68366836
// clear my history;

0 commit comments

Comments
 (0)