From: Nick Bowler Date: Mon, 8 Feb 2010 04:58:57 +0000 (-0500) Subject: liblbx: Clear the image mask when backtracking frames. X-Git-Url: https://git.draconx.ca/gitweb/liblbx.git/commitdiff_plain/5cd07246cf1e87f099c88e89c6aa0a4cfb3b202b liblbx: Clear the image mask when backtracking frames. Without this, undrawn pixels in the first frame will have the pixel values from the previously drawn frame. --- diff --git a/src/image.c b/src/image.c index 9ad154a..76fbfed 100644 --- a/src/image.c +++ b/src/image.c @@ -291,8 +291,10 @@ unsigned char **lbximg_getframe(struct lbx_image *img, int frame) memset(img->mask[0], 0, img->width * img->height); } else { /* Start over if we are backtracking. */ - if (img->currentframe > frame) + if (img->currentframe > frame) { + memset(img->mask[0], 0, img->width * img->height); img->currentframe = -1; + } /* We must have previous frame decoded to continue. */ if (frame > img->currentframe + 1) {