X-Git-Url: http://git.draconx.ca/gitweb/liblbx.git/blobdiff_plain/bbcffc80c95c69d02635b02d37e78912c7f12305..56d402a0f11e7e4dd7f0ddf6882ace22c63d0a8c:/src/image.c?ds=sidebyside diff --git a/src/image.c b/src/image.c index f98238e..d583145 100644 --- a/src/image.c +++ b/src/image.c @@ -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))