From b818038314611bf08c73efdfafc82bd748987899 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 16 Apr 2015 19:42:27 +0200 Subject: [PATCH] Prevent segfault in gfx_ctx_get_metrics --- gfx/video_context_driver.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gfx/video_context_driver.c b/gfx/video_context_driver.c index 02369ddcd9..8d50fc5de8 100644 --- a/gfx/video_context_driver.c +++ b/gfx/video_context_driver.c @@ -174,6 +174,8 @@ bool gfx_ctx_get_metrics(enum display_metric_types type, float *value) const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr(); if (!ctx || !driver) return false; + if (!ctx->get_metrics) + return false; return ctx->get_metrics(driver->video_context_data, type, value); }