]> git.draconx.ca Git - liblbx.git/commitdiff
liblbx: Clear the image mask when backtracking frames.
authorNick Bowler <nbowler@draconx.ca>
Mon, 8 Feb 2010 04:58:57 +0000 (23:58 -0500)
committerNick Bowler <nbowler@draconx.ca>
Mon, 8 Feb 2010 17:00:55 +0000 (12:00 -0500)
Without this, undrawn pixels in the first frame will have the pixel
values from the previously drawn frame.

src/image.c

index 9ad154acd64b779463db4c2e66fabc6dc06fee20..76fbfed3528ccf2d8561c7ee1bf9502e7d6eef99 100644 (file)
@@ -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) {