aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-11-04 12:05:19 -0700
committerRomain Guy <romainguy@google.com>2010-11-04 12:05:19 -0700
commit25c9ae8253171f35b9a14dd2adc5775929330e7b (patch)
tree9b0b19d2b2165c1cea89452bc821b9e849517f14
parent64753df8a61f0423e703d76bbdba820d085b7f3a (diff)
downloadexternal_skia-25c9ae8253171f35b9a14dd2adc5775929330e7b.zip
external_skia-25c9ae8253171f35b9a14dd2adc5775929330e7b.tar.gz
external_skia-25c9ae8253171f35b9a14dd2adc5775929330e7b.tar.bz2
Prevent crash when the Xfermode is null in A8 targets.
Change-Id: I03f1341c4212b08754d6089e8ff4913f65be6099
-rw-r--r--src/core/SkBlitter_A8.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/SkBlitter_A8.cpp b/src/core/SkBlitter_A8.cpp
index 18b0881..37ecdfc 100644
--- a/src/core/SkBlitter_A8.cpp
+++ b/src/core/SkBlitter_A8.cpp
@@ -271,7 +271,7 @@ SkA8_Shader_Blitter::SkA8_Shader_Blitter(const SkBitmap& device, const SkPaint&
SkA8_Shader_Blitter::~SkA8_Shader_Blitter()
{
- fXfermode->safeUnref();
+ if (fXfermode) fXfermode->safeUnref();
sk_free(fBuffer);
}
@@ -377,7 +377,9 @@ void SkA8_Shader_Blitter::blitMask(const SkMask& mask, const SkIRect& clip)
while (--height >= 0)
{
fShader->shadeSpan(x, y, span, width);
- fXfermode->xferA8(device, span, width, alpha);
+ if (fXfermode) {
+ fXfermode->xferA8(device, span, width, alpha);
+ }
y += 1;
device += fDevice.rowBytes();