mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-01-31 05:10:33 +00:00
R_ScreenShot: abort if malloc fails.
This commit is contained in:
parent
e86aabc949
commit
ded9ed51ea
1 changed files with 6 additions and 0 deletions
|
@ -122,6 +122,12 @@ R_ScreenShot(void)
|
|||
}
|
||||
|
||||
buffer = malloc(vid.width * vid.height * 3 + 18);
|
||||
if (!buffer)
|
||||
{
|
||||
VID_Printf(PRINT_ALL, "SCR_ScreenShot_f: Couldn't malloc enough memory\n");
|
||||
return;
|
||||
}
|
||||
|
||||
memset(buffer, 0, 18);
|
||||
buffer[2] = 2; /* uncompressed type */
|
||||
buffer[12] = vid.width & 255;
|
||||
|
|
Loading…
Reference in a new issue