[vlc-commits] bluray: fix SIGSEGV in onMouseEvent
Lucas Werkmeister
git at videolan.org
Mon Oct 1 10:32:50 CEST 2018
vlc | branch: master | Lucas Werkmeister <mail at lucaswerkmeister.de> | Sat Sep 29 19:07:07 2018 +0200| [1c5761b169772f5e2166881ef2635f513749e7e7] | committer: Thomas Guillem
bluray: fix SIGSEGV in onMouseEvent
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.
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1c5761b169772f5e2166881ef2635f513749e7e7
---
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
@@ -1295,8 +1295,10 @@ 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);
More information about the vlc-commits
mailing list