diff --git a/src/CSFML/Audio/Music.cpp b/src/CSFML/Audio/Music.cpp index 200b3194..69b6f21c 100644 --- a/src/CSFML/Audio/Music.cpp +++ b/src/CSFML/Audio/Music.cpp @@ -33,6 +33,8 @@ //////////////////////////////////////////////////////////// sfMusic* sfMusic_createFromFile(const char* filename) { + assert(filename); + auto* music = new sfMusic; if (!music->This.openFromFile(filename)) { diff --git a/src/CSFML/Audio/SoundBuffer.cpp b/src/CSFML/Audio/SoundBuffer.cpp index 41042a1b..81ce1d78 100644 --- a/src/CSFML/Audio/SoundBuffer.cpp +++ b/src/CSFML/Audio/SoundBuffer.cpp @@ -33,6 +33,8 @@ //////////////////////////////////////////////////////////// sfSoundBuffer* sfSoundBuffer_createFromFile(const char* filename) { + assert(filename); + sf::SoundBuffer soundBuffer; if (!soundBuffer.loadFromFile(filename)) return nullptr; @@ -106,6 +108,7 @@ void sfSoundBuffer_destroy(const sfSoundBuffer* soundBuffer) bool sfSoundBuffer_saveToFile(const sfSoundBuffer* soundBuffer, const char* filename) { assert(soundBuffer); + assert(filename); return soundBuffer->This.saveToFile(filename); } diff --git a/src/CSFML/Graphics/Font.cpp b/src/CSFML/Graphics/Font.cpp index a135eadc..8925378d 100644 --- a/src/CSFML/Graphics/Font.cpp +++ b/src/CSFML/Graphics/Font.cpp @@ -34,6 +34,8 @@ //////////////////////////////////////////////////////////// sfFont* sfFont_createFromFile(const char* filename) { + assert(filename); + sf::Font font; if (!font.openFromFile(filename)) return nullptr; diff --git a/src/CSFML/Graphics/Image.cpp b/src/CSFML/Graphics/Image.cpp index f36faf6e..d7015ce0 100644 --- a/src/CSFML/Graphics/Image.cpp +++ b/src/CSFML/Graphics/Image.cpp @@ -58,6 +58,8 @@ sfImage* sfImage_createFromPixels(sfVector2u size, const uint8_t* data) //////////////////////////////////////////////////////////// sfImage* sfImage_createFromFile(const char* filename) { + assert(filename); + sf::Image image; if (!image.loadFromFile(filename)) return nullptr; @@ -110,6 +112,7 @@ void sfImage_destroy(const sfImage* image) bool sfImage_saveToFile(const sfImage* image, const char* filename) { assert(image); + assert(filename); return image->This.saveToFile(filename); } diff --git a/src/CSFML/Graphics/Texture.cpp b/src/CSFML/Graphics/Texture.cpp index 7914be87..20026372 100644 --- a/src/CSFML/Graphics/Texture.cpp +++ b/src/CSFML/Graphics/Texture.cpp @@ -53,6 +53,8 @@ sfTexture* sfTexture_create(sfVector2u size) //////////////////////////////////////////////////////////// sfTexture* sfTexture_createFromFile(const char* filename, const sfIntRect* area) { + assert(filename); + auto* texture = new sfTexture; const sf::IntRect rect = area ? convertRect(*area) : sf::IntRect(); @@ -69,6 +71,8 @@ sfTexture* sfTexture_createFromFile(const char* filename, const sfIntRect* area) //////////////////////////////////////////////////////////// sfTexture* sfTexture_createSrgbFromFile(const char* filename, const sfIntRect* area) { + assert(filename); + auto* texture = new sfTexture; const sf::IntRect rect = area ? convertRect(*area) : sf::IntRect();