diff options
author | Simon Bünzli <zeniko@gmail.com> | 2014-05-09 19:48:53 +0200 |
---|---|---|
committer | Simon Bünzli <zeniko@gmail.com> | 2014-05-12 18:37:46 +0200 |
commit | 277506cad41bd18e76e373457a425dcbf4b3c59e (patch) | |
tree | 37a2acc6c76b1f46e217f6c200fc243f0f4638a0 /source/fitz | |
parent | 13307a97d019f63b58e8475f1320d5bf7000d82d (diff) | |
download | mupdf-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/fitz')
-rw-r--r-- | source/fitz/load-jpeg.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/fitz/load-jpeg.c b/source/fitz/load-jpeg.c index d3701a1e..f3bffd63 100644 --- a/source/fitz/load-jpeg.c +++ b/source/fitz/load-jpeg.c @@ -111,6 +111,11 @@ static int extract_exif_resolution(jpeg_saved_marker_ptr marker, int *xres, int *xres = (int)(x_res * 254 / 100); *yres = (int)(y_res * 254 / 100); } + else + { + *xres = 0; + *yres = 0; + } return 1; } |