Sanity check

This commit is contained in:
Clownacy 2020-04-22 00:13:54 +01:00
parent 6a00057469
commit f006508232

View file

@ -21,11 +21,16 @@ unsigned char* DecodeBitmapFromFile(const char *path, unsigned int *width, unsig
size_t file_size;
unsigned char *file_buffer = LoadFileToMemory(path, &file_size);
if (file_buffer != NULL)
{
unsigned char *pixel_buffer = stbi_load_from_memory(file_buffer, file_size, (int*)width, (int*)height, NULL, 3);
free(file_buffer);
return pixel_buffer;
}
return NULL;
}
void FreeBitmap(unsigned char *buffer)