From 383e9d5368706168498a87d1b7f023f2b59c2f92 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 18 Apr 2007 14:12:20 +0100 Subject: [PATCH] cairo-perf - Check that the surface is created. Exit(1) if we fail to create the target surface. --- perf/cairo-perf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/perf/cairo-perf.c b/perf/cairo-perf.c index 44e842b34..19c993589 100644 --- a/perf/cairo-perf.c +++ b/perf/cairo-perf.c @@ -345,6 +345,13 @@ main (int argc, char *argv[]) perf.size, perf.size, CAIRO_BOILERPLATE_MODE_PERF, &target->closure); + if (surface == NULL) { + fprintf (stderr, + "Error: Failed to create target surface: %s", + target->name); + exit (1); + } + cairo_perf_timer_set_synchronize (target->synchronize, target->closure);