Sanity check
This commit is contained in:
parent
6a00057469
commit
f006508232
1 changed files with 8 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue