Safely-handle LockSurface failing
Fixes crash on Wii U at 1280x720 (LockSurface fails there because CreateSurface fails - maybe it's running out of memory again)
This commit is contained in:
parent
a8d0595bcd
commit
a7f2ec6a5e
1 changed files with 3 additions and 0 deletions
|
@ -154,6 +154,9 @@ static BOOL ScaleAndUploadSurface(const unsigned char *image_buffer, int width,
|
|||
unsigned int pitch;
|
||||
unsigned char *pixels = RenderBackend_LockSurface(surf[surf_no], &pitch, width * magnification, height * magnification);
|
||||
|
||||
if (pixels == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (magnification == 1)
|
||||
{
|
||||
// Just copy the pixels the way they are
|
||||
|
|
Loading…
Add table
Reference in a new issue