summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-09-06 11:55:31 +0200
committerBert <ber.t@gmx.com>2011-09-06 11:55:31 +0200
commit8f34b7e95cc4de30b67eacb264688ca14acaaf60 (patch)
treed788d533dc9ac3044904d1f7ad9cb8d666ff66d1 /main.c
parent14d1daf280f6912b33a57e802cc12a9ee96a3e4f (diff)
downloadnsxiv-8f34b7e95cc4de30b67eacb264688ca14acaaf60.tar.zst
Load as much of a corrupted gif file as possible
Diffstat (limited to 'main.c')
-rw-r--r--main.c12
1 files changed, 6 insertions, 6 deletions
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() {