| Summary: | Crash on mode switch in SDL_SetCursor(NULL) with invisible software mouse cursor. | ||
|---|---|---|---|
| Product: | SDL | Reporter: | bartoldeman |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 1.2.11 | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
| Attachments: | Small patch to test video driver cursor function are not NULL | ||
Created attachment 183 [details]
Small patch to test video driver cursor function are not NULL
There is still a fixme remaining as I don't know how I should fix it correctly
Comment on attachment 183 [details]
Small patch to test video driver cursor function are not NULL
It happens when the video driver does not support mouse cursor (and related function pointers are NULL).
Fixed in SDL-1.2 svn now. |
The following simple program #include <SDL/SDL.h> int main(void) { SDL_Init(SDL_INIT_VIDEO); SDL_ShowCursor(SDL_DISABLE); SDL_SetVideoMode(640,480,8,0); } crashes: #0 0x00000000 in ?? () #1 0x00d703bb in SDL_SetCursor () from /usr/lib/libSDL-1.2.so.0 #2 0x00d75d2c in SDL_SetVideoMode () from /usr/lib/libSDL-1.2.so.0 #3 0x080484f1 in main () at sdl.c:7 for all video output drivers with a software mouse cursor (e.g. aalib, fbdev). The problem is in src/video/SDL_cursor.c, line 222. video->ShowWMCursor(this, NULL); I'm not sure what the best fix would be but checking SDL_cursor->wm_cursor seems logical. There are various workarounds (without changing SDL): temporarily switching showing the cursor during a mode switch for instance. Bart