From 019301b7b2dbd8c57f4e8e761313abb96b62136e Mon Sep 17 00:00:00 2001 From: Raphael Assenat Date: Tue, 8 Dec 2015 21:54:08 -0500 Subject: [PATCH] Fix null pointer dereference --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index c812968..e20e1be 100644 --- a/main.c +++ b/main.c @@ -321,7 +321,7 @@ int main(void) /* Try to auto-detect controller if none*/ if (!pad) { pad = detectPad(); - if (pad->hotplug) { + if (pad && (pad->hotplug)) { // For gamecube, this make sure the next // analog values we read become the center // reference.