mirror of https://github.com/encounter/SDL.git
Fixed crash if allocating memory for mouse clicks failed.
This commit is contained in:
parent
e64c5186e2
commit
7b23eef3b0
|
@ -358,6 +358,7 @@ SDL_PrivateSendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state
|
||||||
|
|
||||||
if (clicks < 0) {
|
if (clicks < 0) {
|
||||||
SDL_MouseClickState *clickstate = GetMouseClickState(mouse, button);
|
SDL_MouseClickState *clickstate = GetMouseClickState(mouse, button);
|
||||||
|
if (clickstate) {
|
||||||
if (state == SDL_PRESSED) {
|
if (state == SDL_PRESSED) {
|
||||||
Uint32 now = SDL_GetTicks();
|
Uint32 now = SDL_GetTicks();
|
||||||
|
|
||||||
|
@ -374,6 +375,9 @@ SDL_PrivateSendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
clicks = clickstate->click_count;
|
clicks = clickstate->click_count;
|
||||||
|
} else {
|
||||||
|
clicks = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Post the event, if desired */
|
/* Post the event, if desired */
|
||||||
|
|
Loading…
Reference in New Issue