aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Hawthorn <john.hawthorn@gmail.com>2010-01-09 14:49:46 -0800
committerJohn Hawthorn <john.hawthorn@gmail.com>2010-01-09 14:49:46 -0800
commitb63719d245db3073db51a75ba3d39cf13ccc3e28 (patch)
tree13b17a9523d60ec8a171ad94aa4d06be921f23a8
parent61f407c4cc6adfaa1184ef010821ac5ac1cef7cb (diff)
downloadmirror-meh-b63719d245db3073db51a75ba3d39cf13ccc3e28.tar.gz
mirror-meh-b63719d245db3073db51a75ba3d39cf13ccc3e28.tar.bz2
mirror-meh-b63719d245db3073db51a75ba3d39cf13ccc3e28.zip
fix segfault when changing images
-rw-r--r--src/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index c609a07..3783ea5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;