mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-07-04 02:32:51 +00:00
fixed a possible crash in IMAGESAVE when SDL_PNGFormatAlpha(s) returns s
This commit is contained in:
parent
d081bfb7ee
commit
e393929237
@ -631,7 +631,7 @@ EX }
|
|||||||
void IMAGESAVE(SDL_Surface *s, const char *fname) {
|
void IMAGESAVE(SDL_Surface *s, const char *fname) {
|
||||||
SDL_Surface *s2 = SDL_PNGFormatAlpha(s);
|
SDL_Surface *s2 = SDL_PNGFormatAlpha(s);
|
||||||
SDL_SavePNG(s2, fname);
|
SDL_SavePNG(s2, fname);
|
||||||
SDL_FreeSurface(s2);
|
if(s != s2) SDL_FreeSurface(s2);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user