Browse Source

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>
pull/4189/head
Jutastre 4 months ago
committed by GitHub
parent
commit
f5d2f8d545
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 1 deletions
  1. +10
    -1
      src/rtextures.c

+ 10
- 1
src/rtextures.c View File

@ -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…
Cancel
Save