Bug: Segmentation Fault in test/graywin

Hello folks,

I got the SDL-SVN version compiled and tried to do the tests.
graywin aborts with a segmentation fault.
I investigated a little and found
SDL_UpdateRects(screen, 1, &area);
from DrawBox made it.

But i don’t get further.

Greetings
Kakarott

From SDL 1.2, one way to crash SDL_UpdateRects() is when the rect is not
clipped to the screen. Can you print out area’s dimensions, just in case?

Jonny DOn Thu, Feb 4, 2010 at 11:19 AM, Kakarott wrote:

Hello folks,

I got the SDL-SVN version compiled and tried to do the tests.
graywin aborts with a segmentation fault.
I investigated a little and found
SDL_UpdateRects(screen, 1, &area);
from DrawBox made it.

But i don’t get further.

Greetings
Kakarott


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

You are right.
That’s it.

I changed this lines:
area.x = X - (area.w / 2);
area.y = Y - (area.h / 2);

into those:
do{ area.x = X - ( area.w / 2); }while( (( area.x < 0) || ( area.x + area.w > screen->w)) && area.w–);
do{ area.y = Y - ( area.h / 2); }while( (( area.y < 0) || ( area.y + area.h > screen->h)) && area.h–);
And that did the trick for me.

But I found other weird things:

  • pushing SPACE does nothing , but should do some WarpMouse
  • pushing RETURN centers the window without border , but should do fullscreen
  • also after in pushing RETURN no keystroke gets to the window, so it’s not possible to close the window ( but to kill it)