diff options
-rw-r--r-- | xps/xps_png.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/xps/xps_png.c b/xps/xps_png.c index 719e522f..4ed9f121 100644 --- a/xps/xps_png.c +++ b/xps/xps_png.c @@ -350,13 +350,14 @@ png_read_phys(struct info *info, unsigned char *p, int size) } static void -png_read_image(struct info *info, unsigned char *p, int total) +png_read_image(fz_context *ctx, struct info *info, unsigned char *p, int total) { int passw[7], passh[7], passofs[8]; int code, size; z_stream stm; memset(info, 0, sizeof (struct info)); + info->ctx = ctx; memset(info->palette, 255, sizeof(info->palette)); info->xres = 96; info->yres = 96; @@ -505,9 +506,7 @@ xps_decode_png(fz_context *ctx, byte *p, int total) struct info png; int stride; - png.ctx = ctx; - - png_read_image(&png, p, total); + png_read_image(ctx, &png, p, total); if (png.n == 3 || png.n == 4) colorspace = fz_device_rgb; |