summaryrefslogtreecommitdiff
path: root/source/xps/xps-zip.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/xps/xps-zip.c')
-rw-r--r--source/xps/xps-zip.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/xps/xps-zip.c b/source/xps/xps-zip.c
index f70a28bf..da1450e3 100644
--- a/source/xps/xps-zip.c
+++ b/source/xps/xps-zip.c
@@ -169,6 +169,12 @@ xps_read_zip_entry(xps_document *doc, xps_entry *ent, unsigned char *outbuf)
}
fz_free(ctx, inbuf);
+
+ if (stream.avail_out > 0)
+ {
+ fz_warn(ctx, "Truncated zipfile entry found, possibly corrupt data");
+ memset(stream.next_out, 0, stream.avail_out);
+ }
}
else
{