From 94ca64f08df3dc80df551c097b621633f36ed0fa Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Sun, 21 Aug 2016 14:18:14 -0700 Subject: [PATCH] Avoid a segfault if shader is not found ('make install' not run) --- src/video_util/sourceUtil.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/video_util/sourceUtil.c b/src/video_util/sourceUtil.c index 9e859f61..8e6099a1 100644 --- a/src/video_util/sourceUtil.c +++ b/src/video_util/sourceUtil.c @@ -30,6 +30,9 @@ static demoSource *srcLoadSource(const char *filepathname) { } FILE *curFile = fopen(filepathname, "r"); + if (!curFile) { + return NULL; + } // Get the size of the source fseek(curFile, 0, SEEK_END);