Prevent segfault in gfx_ctx_get_metrics

This commit is contained in:
twinaphex 2015-04-16 19:42:27 +02:00
parent 7bfca05272
commit b818038314

View File

@ -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);
}