From 8f34b7e95cc4de30b67eacb264688ca14acaaf60 Mon Sep 17 00:00:00 2001 From: Bert Date: Tue, 6 Sep 2011 11:55:31 +0200 Subject: Load as much of a corrupted gif file as possible --- main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 8f73fdd..dedd86e 100644 --- a/main.c +++ b/main.c @@ -99,6 +99,7 @@ void check_add_file(char *filename) { return; } } + files[fileidx].loaded = 0; files[fileidx].name = s_strdup(filename); if (*filename == '/') files[fileidx].path = files[fileidx].name; @@ -198,18 +199,17 @@ void load_image(int new) { new = filecnt - 1; } + files[new].loaded = 1; fileidx = new; if (!stat(files[new].path, &fstats)) filesize = fstats.st_size; else filesize = 0; - if (img.multi.cnt) { - if (img.multi.animate) - set_timeout(animate, img.multi.frames[img.multi.sel].delay, 1); - else - reset_timeout(animate); - } + if (img.multi.cnt && img.multi.animate) + set_timeout(animate, img.multi.frames[img.multi.sel].delay, 1); + else + reset_timeout(animate); } void update_title() { -- cgit v1.2.3