From feacc56fff36111dbaa2af12edf3d6dbfc78f671 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 6 Nov 2016 14:10:25 +0100 Subject: [PATCH] Prevent crash by checking if msg is NULL before doing strlcpy call --- gfx/video_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/video_driver.c b/gfx/video_driver.c index f1e6b9e51c..a9548a996c 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -2121,7 +2121,7 @@ void video_driver_frame(const void *data, unsigned width, video_driver_msg[0] = '\0'; - if (runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_PULL, &msg)) + if (runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_PULL, &msg) && msg) strlcpy(video_driver_msg, msg, sizeof(video_driver_msg)); if (!current_video || !current_video->frame(