[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1870-g194c53e
[email protected] (Ken Sharp) Fri, 15 Nov 2019 17:30:54 +0000 (UTC)
| Newsgroups | gmane.comp.printing.ghostscript.cvs |
|---|---|
| Message-ID | <[email protected]> |
The ghostpdl branch, master has been updated
via 194c53ed02d657159a7be894b6d4b54ce1f435d4 (commit)
from 83c6e520ee6eddeaa1e548e519eb1b42941e3153 (commit)
----------------------------------------------------------------------
commit 194c53ed02d657159a7be894b6d4b54ce1f435d4
Author: Ken Sharp <[email protected]>
Date: Fri Nov 15 17:30:23 2019 +0000
Coverity ID 350163 unchecked return value
Check the return value of xps_fseek and throw an error if it fails.
diff --git a/xps/xpsjxr.c b/xps/xpsjxr.c
index 89eaf19..f19596d 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);
Summary of changes:
xps/xpsjxr.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)