diff options
Diffstat (limited to 'fitz/image_jpeg.c')
-rw-r--r-- | fitz/image_jpeg.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fitz/image_jpeg.c b/fitz/image_jpeg.c index f53b6124..2840adbf 100644 --- a/fitz/image_jpeg.c +++ b/fitz/image_jpeg.c @@ -1,4 +1,4 @@ -#include "fitz.h" +#include "fitz-internal.h" #include <jpeglib.h> #include <setjmp.h> @@ -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); |