diff options
author | Tor Andersson <tor@ghostscript.com> | 2010-06-23 12:02:26 +0200 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2010-06-23 12:02:26 +0200 |
commit | 5b23ef9da8c56458e28b84274159d3cb22696c57 (patch) | |
tree | e0f800c09d03706998a4fb15a9f04d5680c69bd2 | |
parent | 08b3025f9355e53157fadc803fd942debc86d5a2 (diff) | |
download | mupdf-5b23ef9da8c56458e28b84274159d3cb22696c57.tar.xz |
Fix asserts in blit().
-rw-r--r-- | draw/pathscan.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/draw/pathscan.c b/draw/pathscan.c index 319cfeb1..a7c595eb 100644 --- a/draw/pathscan.c +++ b/draw/pathscan.c @@ -443,9 +443,9 @@ static inline void blit(fz_pixmap *pix, int x, int y, int v = (invmat->b * (x + 0.5f) + invmat->d * (y + 0.5f) + invmat->f) * 65536; int fa = invmat->a * 65536; int fb = invmat->b * 65536; - assert(image->n == pix->n); if (color) { + assert(image->n == 1); switch (pix->n) { case 2: @@ -462,14 +462,15 @@ static inline void blit(fz_pixmap *pix, int x, int y, } else if (image->colorspace) { - assert(image->colorspace->n == image->n-1); + assert(image->colorspace->n == image->n - 1); + assert(image->n == pix->n); switch (pix->n) { case 2: fz_img_2o2(list, cov, len, dst, image, u, v, fa, fb); break; case 4: - fz_img_4o4(list, cov, len, dst, image, u, v, fa, fb); + fz_img_4o4(list, cov, len, dst, image, u, v, fa, fb); break; default: assert("Write fz_img_non" != NULL); @@ -478,7 +479,11 @@ static inline void blit(fz_pixmap *pix, int x, int y, } } else + { + assert(image->n == 1); + assert(image->n == pix->n); fz_img_1o1(list, cov, len, dst, image, u, v, fa, fb); + } } else { |