shithub: riscv

Download patch

ref: 02dce7a2e4fd74d918cf7cd1f23fc99279365eb9
parent: 4a9239723609d4f850b1aa7083b712682027136a
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++){