NULL-ptr crash in image_read_ahead_done_cb()
authorMichael Schwendt <mschwendt@gmail.com>
Tue, 11 Aug 2015 22:21:37 +0000 (23:21 +0100)
committerKlaus Ethgen <Klaus@Ethgen.de>
Tue, 11 Aug 2015 22:23:25 +0000 (23:23 +0100)
It's not easy to reproduce, but if one is mad and follows the steps and
presses the keys a few dozens times, there's a slight chance one can
trigger it. Not much to investigate it further.

Forwarding from Sami Farin 2015-08-07 16:40:44 EDT:

 | to reproduce: quickly keep pressing f (fullscreen) and page down
 | (next file) keys.
 |
 | attached patch is a kind of workaround, I did not inspect further
 | is this threading issue etc

Full backtrace: https://bugzilla.redhat.com/attachment.cgi?id=1027647

Patch: https://bugzilla.redhat.com/attachment.cgi?id=1060482&action=diff&context=patch&collapsed=&headers=1&format=raw

src/image.c

index 12fe8fe..603da25 100644 (file)
@@ -475,6 +475,8 @@ static void image_read_ahead_done_cb(ImageLoader *il, gpointer data)
 {
        ImageWindow *imd = data;
 
+       if (!imd->read_ahead_fd || !imd->read_ahead_il) return;
+
        DEBUG_1("%s read ahead done for :%s", get_exec_time(), imd->read_ahead_fd->path);
 
        if (!imd->read_ahead_fd->pixbuf)