[vlc-devel] [PATCH] bluray: fix SIGSEGV in onMouseEvent
Lucas Werkmeister
mail at lucaswerkmeister.de
Sat Sep 29 19:07:07 CEST 2018
If newmouse is NULL, we can directly return from the handler after
initializing (resetting) oldmouse: attempting to detect any differences
between the two states (movements, button presses) only results in a
segmentation fault, since newmouse is still NULL.
Fixes #21118.
---
modules/access/bluray.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index 332de5b438..ff72350220 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -1290,18 +1290,20 @@ static subpicture_t *bluraySubpictureCreate(bluray_overlay_t *p_ov)
/*****************************************************************************
* User input events:
*****************************************************************************/
static void onMouseEvent(const vlc_mouse_t *newmouse, void *user_data)
{
demux_t *p_demux = user_data;
demux_sys_t *p_sys = p_demux->p_sys;
- if (!newmouse)
+ if (!newmouse) {
vlc_mouse_Init(&p_sys->oldmouse);
+ return;
+ }
if (vlc_mouse_HasMoved(&p_sys->oldmouse, newmouse))
bd_mouse_select(p_sys->bluray, -1, newmouse->i_x, newmouse->i_y);
if (vlc_mouse_HasPressed( &p_sys->oldmouse, newmouse, MOUSE_BUTTON_LEFT))
bd_user_input(p_sys->bluray, -1, BD_VK_MOUSE_ACTIVATE);
p_sys->oldmouse = *newmouse;
}
--
2.19.0
More information about the vlc-devel
mailing list