Warning on invalid image data (#4179)
* Adds log warnings on invalid file data * Separate error on missing file extension * Changed LOG_ERROR to LOG_WARNING --------- Co-authored-by: Jutastre <pukarlindgren@gmail.com>
This commit is contained in:
parent
bbcb0109e1
commit
f5d2f8d545
@ -503,7 +503,16 @@ Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, i
|
||||
Image image = { 0 };
|
||||
|
||||
// Security check for input data
|
||||
if ((fileType == NULL) || (fileData == NULL) || (dataSize == 0)) return image;
|
||||
if ((fileData == NULL) || (dataSize == 0))
|
||||
{
|
||||
TRACELOG(LOG_WARNING, "IMAGE: Invalid file data");
|
||||
return image;
|
||||
}
|
||||
if (fileType == NULL)
|
||||
{
|
||||
TRACELOG(LOG_WARNING, "IMAGE: Missing file extension");
|
||||
return image;
|
||||
}
|
||||
|
||||
if ((false)
|
||||
#if defined(SUPPORT_FILEFORMAT_PNG)
|
||||
|
Loading…
Reference in New Issue
Block a user