Commit 7ce065dd authored by Felix Paul Kühne's avatar Felix Paul Kühne

vout_macosx: protect vout_display_SendEvent calls to prevent potential crashes

(cherry picked from commit 0a86a76fec01fe495ace7894c4ecb6be32b4fef7)

Conflicts:
	modules/video_output/macosx.m
parent a520ae9e
......@@ -14,6 +14,7 @@ Mac OS X:
* Fix listing of the lua interfaces (web, telnet and console)
in the advanced preferences panel
* Fix spatializer audio filter panel
* Fix crash within the video output code
Changes between 2.0.4 and 2.0.5:
......
......@@ -708,33 +708,46 @@ static void OpenglSwap (vlc_gl_t *gl)
- (void)mouseDown:(NSEvent *)o_event
{
if ([o_event type] == NSLeftMouseDown && !([o_event modifierFlags] & NSControlKeyMask))
{
@synchronized (self) {
if (vd) {
if ([o_event type] == NSLeftMouseDown && !([o_event modifierFlags] & NSControlKeyMask)) {
if ([o_event clickCount] <= 1)
vout_display_SendEventMousePressed (vd, MOUSE_BUTTON_LEFT);
}
}
}
[super mouseDown:o_event];
}
- (void)otherMouseDown:(NSEvent *)o_event
{
@synchronized (self) {
if (vd)
vout_display_SendEventMousePressed (vd, MOUSE_BUTTON_CENTER);
}
[super otherMouseDown: o_event];
}
- (void)mouseUp:(NSEvent *)o_event
{
@synchronized (self) {
if (vd) {
if ([o_event type] == NSLeftMouseUp)
vout_display_SendEventMouseReleased (vd, MOUSE_BUTTON_LEFT);
}
}
[super mouseUp: o_event];
}
- (void)otherMouseUp:(NSEvent *)o_event
{
@synchronized (self) {
if (vd)
vout_display_SendEventMouseReleased (vd, MOUSE_BUTTON_CENTER);
}
[super otherMouseUp: o_event];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment