From 02dce7a2e4fd74d918cf7cd1f23fc99279365eb9 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 28 Feb 2016 11:44:53 +0100 Subject: [PATCH] games/doom: handle allocimage() failure --- sys/src/games/doom/i_video.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/src/games/doom/i_video.c b/sys/src/games/doom/i_video.c index 334ef567e..5ce432edf 100644 --- a/sys/src/games/doom/i_video.c +++ b/sys/src/games/doom/i_video.c @@ -96,7 +96,7 @@ void I_FinishUpdate(void) if(resized){ resized = 0; if(getwindow(display, Refnone) < 0) - sysfatal("getwindow failed: %r"); + sysfatal("getwindow: %r"); /* make black background */ draw(screen, screen->r, display->black, nil, ZP); @@ -117,6 +117,8 @@ void I_FinishUpdate(void) /* the row image, y-axis gets scaled with repl flag */ rowimg = allocimage(display, Rect(0, 0, scale*SCREENWIDTH, 1), RGB24, 1, DNofill); + if(rowimg == nil) + sysfatal("allocimage: %r"); s = screens[0]; for(y = 0; y < SCREENHEIGHT; y++){