From 9c47c8202644e20e6ae054a6c7ddf09b6a0e4808 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 7 Apr 2019 09:58:36 +0200 Subject: mg2d: do not crash if print_stats() is called before any solves --- mg2d.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mg2d.c b/mg2d.c index c9070fb..b1c7fb7 100644 --- a/mg2d.c +++ b/mg2d.c @@ -772,6 +772,9 @@ void mg2d_print_stats(MG2DContext *ctx, const char *prefix) MG2DLevel *level = priv->root; int64_t other, levels_total = 0; + if (!level) + return; + if (!prefix) prefix = ""; -- cgit v1.2.3