summaryrefslogtreecommitdiff
path: root/source/xps
diff options
context:
space:
mode:
authorSimon Bünzli <zeniko@gmail.com>2014-05-09 19:48:53 +0200
committerSimon Bünzli <zeniko@gmail.com>2014-05-12 18:37:46 +0200
commit277506cad41bd18e76e373457a425dcbf4b3c59e (patch)
tree37a2acc6c76b1f46e217f6c200fc243f0f4638a0 /source/xps
parent13307a97d019f63b58e8475f1320d5bf7000d82d (diff)
downloadmupdf-277506cad41bd18e76e373457a425dcbf4b3c59e.tar.xz
prevent indeterminacy by uninitialized variables
There are two issues where variables may be used unitialized: * extract_exif_resolution fails to set xres and yres for JPEG images if there's no valid resolution unit (mainly affects XPS documents) * xps_measure_font_glyph uses hadv and vadv unitialized if the glyph id isn't valid (i.e. if FT_Get_Advance fails)
Diffstat (limited to 'source/xps')
-rw-r--r--source/xps/xps-glyphs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/xps/xps-glyphs.c b/source/xps/xps-glyphs.c
index e621257e..afd9266f 100644
--- a/source/xps/xps-glyphs.c
+++ b/source/xps/xps-glyphs.c
@@ -56,7 +56,7 @@ xps_measure_font_glyph(xps_document *doc, fz_font *font, int gid, xps_glyph_metr
{
int mask = FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM;
FT_Face face = font->ft_face;
- FT_Fixed hadv, vadv;
+ FT_Fixed hadv = 0, vadv = 0;
fz_context *ctx = doc->ctx;
fz_lock(ctx, FZ_LOCK_FREETYPE);