]> git.draconx.ca Git - liblbx.git/commitdiff
liblbx: Fix broken logic when decoding earlier image frames.
authorNick Bowler <nbowler@draconx.ca>
Thu, 4 Feb 2010 20:25:21 +0000 (15:25 -0500)
committerNick Bowler <nbowler@draconx.ca>
Mon, 8 Feb 2010 17:00:55 +0000 (12:00 -0500)
The lbximg tool always decodes frames in order, so the errors were never
made visible.

src/image.c

index f98238e49edb0f79395551d14ed4c7c9e66599fb..d58314544373a38ce86825d1ed4e511aa1044062 100644 (file)
@@ -282,15 +282,16 @@ unsigned char **lbximg_getframe(struct lbx_image *img, int frame)
                        return NULL;
        }
 
-       /* Start over if we are backtracking. */
-       if (img->currentframe > frame)
-               img->currentframe == -1;
-
        if (img->flags & FLAG_OVERWRITE) {
                /* Clear the slate. */
+               img->currentframe = -1;
                memset(img->framedata[0], 0, img->width * img->height);
                memset(img->mask[0],      0, img->width * img->height);
        } else {
+               /* Start over if we are backtracking. */
+               if (img->currentframe > frame)
+                       img->currentframe = -1;
+
                /* We must have previous frame decoded to continue. */
                if (frame > img->currentframe + 1) {
                        if (!lbximg_getframe(img, frame-1))