summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fitz/image_jpeg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fitz/image_jpeg.c b/fitz/image_jpeg.c
index f53b6124..cef53d93 100644
--- a/fitz/image_jpeg.c
+++ b/fitz/image_jpeg.c
@@ -115,6 +115,9 @@ fz_load_jpeg(fz_context *ctx, unsigned char *rbuf, int rlen)
image->yres = cinfo.Y_density * 254 / 100;
}
+ if (image->xres <= 0) image->xres = 72;
+ if (image->yres <= 0) image->yres = 72;
+
fz_clear_pixmap(ctx, image);
row[0] = fz_malloc(ctx, cinfo.output_components * cinfo.output_width);