diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2016-06-06 13:12:06 +0100 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2016-06-06 13:12:06 +0100 |
commit | 1d1bcc3997e44f36b5559163cca738091c035813 (patch) | |
tree | c112022f8beebc5edde72f7bd4ddaea742e563de | |
parent | d020de175b5c26f9fb06d28fa3e2010ba4dbfcb9 (diff) | |
download | ghostpdl-1d1bcc3997e44f36b5559163cca738091c035813.tar.gz |
Coverity ID 95084
Turns out there were two places where we needed a NULL dererference
check
-rw-r--r-- | devices/gdevxcmp.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/devices/gdevxcmp.c b/devices/gdevxcmp.c index bd55f0e22..e862d18e9 100644 --- a/devices/gdevxcmp.c +++ b/devices/gdevxcmp.c @@ -342,12 +342,13 @@ gdev_x_setup_colors(gx_device_X * xdev) if (xdev->cman.std_cmap.map || (xdev->vinfo->class == TrueColor && alloc_std_cmap(xdev, true)) ) { - xdev->color_info.dither_grays = xdev->color_info.dither_colors = - min(xdev->cman.std_cmap.map->red_max, - min(xdev->cman.std_cmap.map->green_max, - xdev->cman.std_cmap.map->blue_max)) + 1; - if (xdev->cman.std_cmap.map) + if (xdev->cman.std_cmap.map) { + xdev->color_info.dither_grays = xdev->color_info.dither_colors = + min(xdev->cman.std_cmap.map->red_max, + min(xdev->cman.std_cmap.map->green_max, + xdev->cman.std_cmap.map->blue_max)) + 1; set_std_cmap(xdev, xdev->cman.std_cmap.map); + } } else #endif /* Otherwise set up a rgb cube of our own */ |