Assert string arguments are not null

For these functions, providing a null pointer argument would result
in invoking undefined behavior.
This commit is contained in:
Chris Thrasher committed 2024-09-16 21:52:54 -04:00
1 parent 21d4571d5b
commit d26c691458
3 files changed
+3

No files matched your search

+1
View File
@@ -81,6 +81,7 @@ const sfSoundBuffer* sfSoundBufferRecorder_getBuffer(const sfSoundBufferRecorder
bool sfSoundBufferRecorder_setDevice(sfSoundBufferRecorder* soundBufferRecorder, const char* name)
{
assert(soundBufferRecorder);
assert(name);
return soundBufferRecorder->This.setDevice(name);
}
+1
View File
@@ -113,6 +113,7 @@ const char* sfSoundRecorder_getDefaultDevice()
bool sfSoundRecorder_setDevice(sfSoundRecorder* soundRecorder, const char* name)
{
assert(soundRecorder);
assert(name);
return soundRecorder->This.setDevice(name);
}
+1
View File
@@ -122,6 +122,7 @@ bool sfImage_saveToMemory(const sfImage* image, sfBuffer* output, const char* fo
{
assert(image);
assert(output);
assert(format);
auto data = image->This.saveToMemory(format);