summaryrefslogtreecommitdiff
path: root/source/fitz/stext-device.c
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2016-05-25 00:37:04 +0200
committerSebastian Rasmussen <sebras@gmail.com>2016-06-14 00:44:28 +0200
commit163c30cf09bfc9e02abbc85fd02905ee9136abb4 (patch)
tree8f9d681e4126e1ef7c661ac69ace8760280736e0 /source/fitz/stext-device.c
parent46b75f288d877af0d307259f7b454df02ee83c10 (diff)
downloadmupdf-163c30cf09bfc9e02abbc85fd02905ee9136abb4.tar.xz
stext: Non-initial glyphs in ligatures must set start/stop.
Normal glyphs and inital glyphs in ligatures have their start/stop (p and q) set before determining whether to append to an existing span or insert a space. For non-initial glyphs the start/stop were never set which introduced uninitialized values into the span data structure. Now, all glyphs have their start/stop set and then if it is a non-initial glyph in a ligature the append and space detection is ignored. This means that no values are uninitialized.
Diffstat (limited to 'source/fitz/stext-device.c')
-rw-r--r--source/fitz/stext-device.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/fitz/stext-device.c b/source/fitz/stext-device.c
index 94ff9fd6..87ba7cba 100644
--- a/source/fitz/stext-device.c
+++ b/source/fitz/stext-device.c
@@ -577,9 +577,6 @@ fz_add_stext_char_imp(fz_context *ctx, fz_stext_device *dev, fz_stext_style *sty
float spacing = 0;
float base_offset = 0;
- if (glyph < 0)
- goto no_glyph;
-
if (wmode == 0)
{
dir.x = 1;
@@ -627,6 +624,9 @@ fz_add_stext_char_imp(fz_context *ctx, fz_stext_device *dev, fz_stext_style *sty
q.y = trm->f;
}
+ if (glyph < 0)
+ goto no_glyph;
+
if (dev->cur_span == NULL ||
trm->a != dev->cur_span->transform.a || trm->b != dev->cur_span->transform.b ||
trm->c != dev->cur_span->transform.c || trm->d != dev->cur_span->transform.d ||