nsxivcc479ca
Fixed segfault when removing first image from file list, fixes issue #112
+3 −3
2 files changed
| @@ -1,4 +1,4 @@ | |||
| 1 | − | VERSION = git-20131114 | |
| 1 | + | VERSION = git-20131116 | |
| 2 | 2 | ||
| 3 | 3 | PREFIX = /usr/local | |
| 4 | 4 | MANPREFIX = $(PREFIX)/share/man | |
| @@ -296,7 +296,7 @@ void load_image(int new) | |||
| 296 | 296 | remove_file(new, false); | |
| 297 | 297 | if (new >= filecnt) | |
| 298 | 298 | new = filecnt - 1; | |
| 299 | − | else if (new < fileidx) | |
| 299 | + | else if (new > 0 && new < fileidx) | |
| 300 | 300 | new--; | |
| 301 | 301 | } | |
| 302 | 302 | files[new].loaded = true; | |
| @@ -532,7 +532,7 @@ void run(void) | |||
| 532 | 532 | tns.cnt++; | |
| 533 | 533 | } else { | |
| 534 | 534 | remove_file(tns.cnt, false); | |
| 535 | − | if (tns.sel >= tns.cnt) | |
| 535 | + | if (tns.sel > 0 && tns.sel >= tns.cnt) | |
| 536 | 536 | tns.sel--; | |
| 537 | 537 | } | |
| 538 | 538 | if (tns.cnt == filecnt) | |