Sfoglia il codice sorgente

Added a note that SDL_LoadPNG() is designed for trusted images

Fixes https://github.com/libsdl-org/SDL/issues/14338
Sam Lantinga 4 mesi fa
parent
commit
f5966890b0
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      include/SDL3/SDL_surface.h

+ 4 - 0
include/SDL3/SDL_surface.h

@@ -597,6 +597,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *f
 /**
  * Load a PNG image from a seekable SDL data stream.
  *
+ * This is intended as a convenience function for loading images from trusted sources. If you want to load arbitrary images you should use libpng or another image loading library designed with security in mind.
+ *
  * The new surface should be freed with SDL_DestroySurface(). Not doing so
  * will result in a memory leak.
  *
@@ -619,6 +621,8 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadPNG_IO(SDL_IOStream *src, bool
 /**
  * Load a PNG image from a file.
  *
+ * This is intended as a convenience function for loading images from trusted sources. If you want to load arbitrary images you should use libpng or another image loading library designed with security in mind.
+ *
  * The new surface should be freed with SDL_DestroySurface(). Not doing so
  * will result in a memory leak.
  *