aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libstorycode/narrative_render_cairo.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libstorycode/narrative_render_cairo.c b/libstorycode/narrative_render_cairo.c
index ee5e67d..2ab808d 100644
--- a/libstorycode/narrative_render_cairo.c
+++ b/libstorycode/narrative_render_cairo.c
@@ -187,6 +187,9 @@ size_t narrative_pos_trail_to_offset(Narrative *n, int i, int offs, int trail)
run = narrative_which_run(item, offs, &run_offs);
+ assert(item != NULL);
+ assert(run < item->n_runs);
+ assert(item->runs[run].text != NULL);
char_offs = g_utf8_pointer_to_offset(item->runs[run].text,
item->runs[run].text+run_offs);
char_offs += trail;