diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2010-05-28 16:06:35 +0000 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2010-05-28 16:06:35 +0000 |
commit | ca8f608b7e2f2f3495e4e1c28820825e3a5547ae (patch) | |
tree | 62532f42268d7b800ff3632dedd150897b3a8cf6 /xps | |
parent | 0072f9e2745d90412eb0dfcfde51fbb10b926fb6 (diff) |
Catch and swallow image loading errors when scanning a page for transparency.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11336 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'xps')
-rw-r--r-- | xps/xpsimage.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/xps/xpsimage.c b/xps/xpsimage.c index b652d086b..c20862a77 100644 --- a/xps/xpsimage.c +++ b/xps/xpsimage.c @@ -356,17 +356,26 @@ xps_image_brush_has_transparency(xps_context_t *ctx, char *base_uri, xps_item_t code = xps_find_image_brush_source_part(ctx, base_uri, root, &part); if (code < 0) - return gs_rethrow(code, "cannot find image source"); + { + gs_catch(code, "cannot find image source"); + return 0; + } /* Hmm, we should be smarter here and only look at the image header */ image = xps_alloc(ctx, sizeof(xps_image_t)); if (!image) - return gs_throw(-1, "out of memory: image struct"); + { + gs_catch(-1, "out of memory: image struct"); + return 0; + } code = xps_decode_image(ctx, part, image); if (code < 0) - return gs_rethrow(-1, "cannot decode image resource"); + { + gs_catch(-1, "cannot decode image resource"); + return 0; + } has_alpha = image->alpha != NULL; |