From 7fb6b0485a7935eb85354b76d165b1804c22c4cc Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 2 Jan 2017 05:09:34 +0100 Subject: [PATCH] Put this back --- src/video.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/video.c b/src/video.c index b89d4a5..c20d2ae 100644 --- a/src/video.c +++ b/src/video.c @@ -46,8 +46,12 @@ void FCEU_KillVirtualVideo(void) int FCEU_InitVirtualVideo(void) { - // 256 bytes per scanline, * 240 scanline maximum, +8 for alignment, - XBuf = (uint8*)(FCEU_malloc(256 * (256 + extrascanlines + 8))); + /* 256 bytes per scanline, * 240 scanline maximum, +8 for alignment, */ + if (!XBuf) + XBuf = (uint8*)(FCEU_malloc(256 * (256 + extrascanlines + 8))); + + if (!XBuf) + return 0; memset(XBuf, 128, 256 * (256 + extrascanlines)); return 1;