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:
Clownacy 2020-04-23 19:53:33 +01:00
parent a8d0595bcd
commit a7f2ec6a5e

View file

@ -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