[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paragui-users] PG_Draw::CreateRGBSurface() segfault
From: |
Peter Kasting |
Subject: |
[paragui-users] PG_Draw::CreateRGBSurface() segfault |
Date: |
Tue, 09 Sep 2003 17:42:26 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 |
This message was originally sent to Alexander Pipelka directly, and he
asked me to send it to this mailing list. I'm not a subscriber, so
until that happens (depends on how much ParaGUI work I wind up doing),
feel free to CC me directly on any replies to this you make.
> I caught a segfault today in PG_Draw::CreateRGBSurface(). It gets the
> SDL Video surface and then blindly dereferences the pointer without
> checking for NULL. Thus if you try to call this before you've called
> PG_Application::InitScreen(), you segfault. It seems like at least the
> function should check for NULL and fail (i.e. return NULL itself);
> possibly even better would be to fall back on some default set of
> bitmasks etc.
>
> I also wondered about PG_Draw::BlitSurface() -- there seems to be no way
> to duplicate the behavior of the SDL_BlitSurface() call for the case
> where one or both of the SDL_Rect parameters were NULL (which meant,
> "use the entire surface in question"). Is this intentional (i.e.
> developers wanting this sort of behavior should call SDL_BlitSurface()
> directly, not PG_Draw::BlitSurface()), or is it an unintentional
> oversight/artifact of the design? It seems like if there were some
> const static PG_Rect called "NULLRect" or something, then people could
> call PG_Draw::BlitSurface(..., PG_Rect::NULLRect, ...) to get the
> behavior they wanted (the function would then check for NULLRect and
> pass a NULL pointer on to SDL_BlitSurface()). I just prefer to have all
> my Blitting calls go through the same function, is why I want this
> capability...
PK
- [paragui-users] PG_Draw::CreateRGBSurface() segfault,
Peter Kasting <=