git: 9front

Download patch

ref: 0d20f5190da90d2b15ddbf957181d8565b2cf123
parent: 065eba90017be6d23ea72a062e5a533d6bb59227
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Feb 28 06:44:53 EST 2016

games/doom: handle allocimage() failure

--- a/sys/src/games/doom/i_video.c
+++ b/sys/src/games/doom/i_video.c
@@ -96,7 +96,7 @@
 	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 @@
 
 	/* 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++){
--