diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2013-10-31 14:15:29 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2013-10-31 14:15:29 +0100 |
commit | 7aa2806dc5c74d56929e2f2bafeaeed20e364609 (patch) | |
tree | fa3f804c8f3bb826d7398afea32d197f5d687c3e /source/fitz/pixmap.c | |
parent | db7847f2c8a4d15d858941b86ef90c1714b78717 (diff) | |
download | mupdf-7aa2806dc5c74d56929e2f2bafeaeed20e364609.tar.xz |
Fix segv bug in clear_pixmap_with_value functions.
Image masks don't have a colorspace; check before dereferencing.
Diffstat (limited to 'source/fitz/pixmap.c')
-rw-r--r-- | source/fitz/pixmap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/fitz/pixmap.c b/source/fitz/pixmap.c index fc754175..a130a228 100644 --- a/source/fitz/pixmap.c +++ b/source/fitz/pixmap.c @@ -143,7 +143,7 @@ void fz_clear_pixmap_with_value(fz_context *ctx, fz_pixmap *pix, int value) { /* CMYK needs special handling (and potentially any other subtractive colorspaces) */ - if (pix->colorspace->n == 4) + if (pix->colorspace && pix->colorspace->n == 4) { value = 255 - value; int x, y; @@ -302,7 +302,7 @@ fz_clear_pixmap_rect_with_value(fz_context *ctx, fz_pixmap *dest, int value, con destp = dest->samples + (unsigned int)(destspan * (local_b.y0 - dest->y) + dest->n * (local_b.x0 - dest->x)); /* CMYK needs special handling (and potentially any other subtractive colorspaces) */ - if (dest->colorspace->n == 4) + if (dest->colorspace && dest->colorspace->n == 4) { value = 255 - value; do |