Browse Source

REVIEWED: `LoadImageRaw()` #3926

pull/3912/head
Ray 9 months ago
parent
commit
8f24d86c1f
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/rtextures.c

+ 2
- 1
src/rtextures.c View File

@ -316,7 +316,8 @@ Image LoadImageRaw(const char *fileName, int width, int height, int format, int
unsigned char *dataPtr = fileData;
unsigned int size = GetPixelDataSize(width, height, format);
if (headerSize > 0) dataPtr += headerSize;
// Offset file data to expected raw image by header size
if ((headerSize > 0) && ((headerSize + size) <= dataSize)) dataPtr += headerSize;
image.data = RL_MALLOC(size); // Allocate required memory in bytes
memcpy(image.data, dataPtr, size); // Copy required data to image

Loading…
Cancel
Save