mettli / guichan

Automatically exported from code.google.com/p/guichan
Other
0 stars 0 forks source link

SDLImage should perform a null check when converting an image to display format as it might fail and throw an exception upon failure #110

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The conversion might fail when an image is larger than the resolution.
For details, check the pasted mail below:

Hi,

For information I have successfully ported guichan on windows ce and since
your code
is very clean it was an esay game.
I will provide you my Visual project when you will have fixed screenshots
on sourceforge ;-).
Please also modify in sdlimage L163 :

if (tmp)
               {
                       if (hasPink)
                       {
                               SDL_SetColorKey(tmp, SDL_SRCCOLORKEY,
                                       SDL_MapRGB(tmp->format,255,0,255));
                       }

                       if (hasAlpha)
                       {
                               SDL_SetAlpha(tmp, SDL_SRCALPHA, 255);
                       }
               }

Because sometimes tmp is NULL and it makes crashs.

Vincent Richomme.

Original issue reported on code.google.com by olof.nae...@gmail.com on 27 Apr 2009 at 4:51

GoogleCodeExporter commented 9 years ago
Has been fixed.

Original comment by olof.nae...@gmail.com on 1 May 2009 at 1:36