aboutsummaryrefslogtreecommitdiff
path: root/src/frame.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-09-24 20:48:53 +0200
committerThomas White <taw@physics.org>2017-09-24 20:48:53 +0200
commita86853b86674d1ecf917665fd8323b8e48c919d9 (patch)
treef57fba3c574e5af2cadb2bd26086d2fe9663926d /src/frame.c
parenta75acf2bb1ef843a47d0772f888a6a7a44f363a6 (diff)
Don't try to calculate an offset in a non-text paragraph
Diffstat (limited to 'src/frame.c')
-rw-r--r--src/frame.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/frame.c b/src/frame.c
index 1dc9f4f..8c6acc6 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -842,6 +842,8 @@ size_t pos_trail_to_offset(Paragraph *para, size_t offs, int trail)
nrun = which_run(para, offs);
run = &para->runs[nrun];
+ if ( para->type != PARA_TYPE_TEXT ) return 0;
+
if ( run == NULL ) {
fprintf(stderr, "pos_trail_to_offset: No run\n");
return 0;