diff options
author | John Hawthorn <john.hawthorn@gmail.com> | 2010-01-09 14:49:46 -0800 |
---|---|---|
committer | John Hawthorn <john.hawthorn@gmail.com> | 2010-01-09 14:49:46 -0800 |
commit | b63719d245db3073db51a75ba3d39cf13ccc3e28 (patch) | |
tree | 13b17a9523d60ec8a171ad94aa4d06be921f23a8 | |
parent | 61f407c4cc6adfaa1184ef010821ac5ac1cef7cb (diff) | |
download | mirror-meh-b63719d245db3073db51a75ba3d39cf13ccc3e28.tar.gz mirror-meh-b63719d245db3073db51a75ba3d39cf13ccc3e28.tar.bz2 mirror-meh-b63719d245db3073db51a75ba3d39cf13ccc3e28.zip |
fix segfault when changing images
-rw-r--r-- | src/main.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -86,7 +86,8 @@ void key_reload(){ } void key_next(){ if(mode != MODE_CTL){ - curimg->state &= LOADED | SLOWLOADED; + if(curimg) + curimg->state &= LOADED | SLOWLOADED; freeimage(previmg); previmg = curimg; curimg = nextimg; @@ -100,7 +101,8 @@ void key_next(){ } void key_prev(){ if(mode != MODE_CTL){ - curimg->state &= LOADED | SLOWLOADED; + if(curimg) + curimg->state &= LOADED | SLOWLOADED; freeimage(nextimg); nextimg = curimg; curimg = previmg; |