feh
feh copied to clipboard
Segmentation fault when turn on auto zoom via menu
Since 083a71e948290894e707, the winwid was NULL when I
- right click to open menu
- select autozoom (probably all menu option could make winwid has NULL, but I only used autozoom)
- Segmentation fault
diff --git a/src/events.c b/src/events.c
index 235ad53..48b3cc1 100644
--- a/src/events.c
+++ b/src/events.c
@@ -80,7 +80,7 @@ static void feh_event_handle_ButtonPress(XEvent * ev)
winwidget_show_menu(winwid);
}
} else if ((ev->xbutton.button == opt.rotate_button)
- && (winwid->type != WIN_TYPE_THUMBNAIL)
+ && (winwid && winwid->type != WIN_TYPE_THUMBNAIL)
&& ((opt.no_rotate_ctrl_mask)
|| (ev->xbutton.state & ControlMask))) {
if (winwid != NULL) {
@@ -89,7 +89,7 @@ static void feh_event_handle_ButtonPress(XEvent * ev)
D(("rotate starting at %d, %d\\n", ev->xbutton.x, ev->xb
utton.y));
}
} else if ((ev->xbutton.button == opt.blur_button)
- && (winwid->type != WIN_TYPE_THUMBNAIL)
+ && (winwid && winwid->type != WIN_TYPE_THUMBNAIL)
&& ((opt.no_blur_ctrl_mask)
|| (ev->xbutton.state & ControlMask))) {
if (winwid != NULL) {
This seems to be happening with all menu options - https://bugs.archlinux.org/task/25612
Arg. Yeah, major fail on my side. Thanks for the patch!