Fixed NULL dereference on drop events with no window associated.
(such as when dropping a file onto an app's icon to launch.) This bug caught by Clang's static analyzer. --HG-- extra : rebase_source : 9e90fa6608a55376e45e2c0af0252cb03c8544cf
This commit is contained in:
parent
81d9973057
commit
9e04e93494
1 changed files with 5 additions and 1 deletions
|
@ -43,7 +43,11 @@ SDL_SendDrop(SDL_Window *window, const SDL_EventType evtype, const char *data)
|
|||
if (need_begin) {
|
||||
SDL_zero(event);
|
||||
event.type = SDL_DROPBEGIN;
|
||||
event.drop.windowID = window->id;
|
||||
|
||||
if (window) {
|
||||
event.drop.windowID = window->id;
|
||||
}
|
||||
|
||||
posted = (SDL_PushEvent(&event) > 0);
|
||||
if (!posted) {
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue