summaryrefslogtreecommitdiff
path: root/meme/gui.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-02-14 21:38:47 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-02-14 21:38:47 (GMT)
commit43831d54bfff78c6ec91e703e4647610af59b901 (patch)
tree2c05c532569fea4addb72ffb7c71d075596df1f1 /meme/gui.c
parent5551daea48a8e1363e67a2a77de7b6b9c0acfa14 (diff)
downloadmisc-43831d54bfff78c6ec91e703e4647610af59b901.zip
misc-43831d54bfff78c6ec91e703e4647610af59b901.tar.gz
misc-43831d54bfff78c6ec91e703e4647610af59b901.tar.bz2
meme/gui.c (draw_overlay): don't try to draw overlays if we don't have any
This caused a segfault.
Diffstat (limited to 'meme/gui.c')
-rw-r--r--meme/gui.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/meme/gui.c b/meme/gui.c
index 2ecdafe..7ee2281 100644
--- a/meme/gui.c
+++ b/meme/gui.c
@@ -67,7 +67,7 @@ static bool show_profiles = 0;
static bool show_overlay = 0;
static bool show_mesh = 1;
static const struct vertex *cursor;
-static const struct overlay *overlay;
+static const struct overlay *overlay = NULL;
/* ----- Coordinate transform ---------------------------------------------- */
@@ -940,7 +940,8 @@ static void lineto(void *user, int x, int y)
static void draw_overlay(SDL_Surface *s, const struct overlay *over)
{
- overlay_draw(over, moveto, lineto, s);
+ if (over)
+ overlay_draw(over, moveto, lineto, s);
}