# HG changeset patch # User Sam Lantinga # Date 1297363055 28800 # Node ID 78ce7bfd0faf26871d32b0520e90927bba620182 # Parent 189b1bdb7bafd44b1bfc2d527b8cfd3c8657511b Better window parameter checking diff -r 189b1bdb7baf -r 78ce7bfd0faf src/video/SDL_video.c --- a/src/video/SDL_video.c Thu Feb 10 05:10:05 2011 -0800 +++ b/src/video/SDL_video.c Thu Feb 10 10:37:35 2011 -0800 @@ -1339,13 +1339,20 @@ void SDL_GetWindowPosition(SDL_Window * window, int *x, int *y) { - CHECK_WINDOW_MAGIC(window, ); - - if (x) { - *x = window->x; - } - if (y) { - *y = window->y; + if (_this && window && window->magic == &_this->window_magic) { + if (x) { + *x = window->x; + } + if (y) { + *y = window->y; + } + } else { + if (x) { + *x = 0; + } + if (y) { + *y = 0; + } } } @@ -1366,7 +1373,7 @@ void SDL_GetWindowSize(SDL_Window * window, int *w, int *h) { - if (window) { + if (_this && window && window->magic == &_this->window_magic) { if (w) { *w = window->w; }