diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2017-09-05 15:12:09 +0100 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2017-09-05 15:29:42 +0100 |
commit | 28e95004b508a3f4cd73552d92f7f4cd699c645b (patch) | |
tree | d8a5ae3580f3aa46790639ac15fd36ef69e52642 | |
parent | 05c3de8915fafb65b96ba0860523a7a79e2577e2 (diff) | |
download | ghostpdl-28e95004b508a3f4cd73552d92f7f4cd699c645b.tar.gz |
Coverity ID# 127201
Fix potential NULL pgs (graphics state) pointer dereference. I suspect this can
never occur, but it's cheap and should silence coverity
-rw-r--r-- | base/gxipixel.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/base/gxipixel.c b/base/gxipixel.c index ab205bc51..21b3c3508 100644 --- a/base/gxipixel.c +++ b/base/gxipixel.c @@ -427,9 +427,10 @@ gx_image_enum_begin(gx_device * dev, const gs_gstate * pgs, { gs_rect rect, rect_out; gs_matrix mi; + gs_matrix *m = pgs != NULL ? &ctm_only(pgs) : NULL; gs_fixed_rect obox; gs_int_rect irect; - if ((code = gs_matrix_invert(&ctm_only(pgs), &mi)) < 0 || + if (m == NULL || (code = gs_matrix_invert(m, &mi)) < 0 || (code = gs_matrix_multiply(&mi, &pic->ImageMatrix, &mi)) < 0) { /* Give up trying to shrink the render box, but continue processing */ break; |