fix null-pointer deref in SkComposeShader::toString()
authorhalcanary <halcanary@google.com>
Tue, 16 Jun 2015 18:53:26 +0000 (11:53 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 16 Jun 2015 18:53:26 +0000 (11:53 -0700)
Review URL: https://codereview.chromium.org/1185893007

src/core/SkComposeShader.cpp

index 3c6623d29128e2be3b16fb9cfbc1f65df7b9ad32..c16d7ffc578f352f948d432934c68c41851c6623 100644 (file)
@@ -202,8 +202,10 @@ void SkComposeShader::toString(SkString* str) const {
     fShaderA->toString(str);
     str->append(" ShaderB: ");
     fShaderB->toString(str);
-    str->append(" Xfermode: ");
-    fMode->toString(str);
+    if (fMode) {
+        str->append(" Xfermode: ");
+        fMode->toString(str);
+    }
 
     this->INHERITED::toString(str);