summaryrefslogtreecommitdiff
path: root/xps
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2019-11-15 17:30:23 +0000
committerKen Sharp <ken.sharp@artifex.com>2019-11-15 17:30:47 +0000
commit194c53ed02d657159a7be894b6d4b54ce1f435d4 (patch)
tree44e0f09b81e6c7cfdcb7d359b91e427f75032284 /xps
parent83c6e520ee6eddeaa1e548e519eb1b42941e3153 (diff)
downloadghostpdl-194c53ed02d657159a7be894b6d4b54ce1f435d4.tar.gz
Coverity ID 350163 unchecked return value
Check the return value of xps_fseek and throw an error if it fails.
Diffstat (limited to 'xps')
-rw-r--r--xps/xpsjxr.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/xps/xpsjxr.c b/xps/xpsjxr.c
index 89eaf1994..f19596d36 100644
--- a/xps/xpsjxr.c
+++ b/xps/xpsjxr.c
@@ -236,7 +236,13 @@ xps_decode_jpegxr(xps_context_t *ctx, byte *buf, int len, xps_image_t *output)
state.output = output;
jxr_set_user_data(image, &state);
- xps_fseek(file, offset, SEEK_SET);
+ rc = xps_fseek(file, offset, SEEK_SET);
+ if (rc < 0) {
+ xps_free(ctx, name);
+ jxr_destroy_container(container);
+ return gs_throw1(-1, "jxr_read_image_bitstream: %s", jxr_error_string(rc));
+ }
+
rc = jxr_read_image_bitstream(image, gp_get_file(file));
if (rc < 0) {
xps_free(ctx, name);