Correct bug in which Backend_LockSurface would not initialize surface->pixels, leaving a bug in which Backend_UnlockSurface used uninitialized values in certain scenarios (such as in ScaleAndUploadSurface)
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
This commit is contained in:
parent
befb5f7fb5
commit
752b4cee3f
1 changed files with 1 additions and 1 deletions
|
@ -154,7 +154,7 @@ unsigned char* Backend_LockSurface(Backend_Surface *surface, unsigned int *pitch
|
|||
|
||||
*pitch = surface->width * 3;
|
||||
|
||||
surface->pixels = (unsigned char*)malloc(surface->width * surface->height * 3);
|
||||
surface->pixels = (unsigned char*)calloc(surface->width * surface->height * 3, 1); // Make sure these are initialized
|
||||
|
||||
return surface->pixels;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue