From 6f76664d36151ac3d9222b4ae436bab96e34f0b0 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Thu, 4 Feb 2010 15:25:21 -0500 Subject: [PATCH] liblbx: Fix broken logic when decoding earlier image frames. The lbximg tool always decodes frames in order, so the errors were never made visible. --- src/image.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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)) -- 2.43.2