Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Unified Diff: src/effects/SkColorFilterImageFilter.cpp

Issue 675013003: Trying to be consistent when members are allowed to be NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/effects/SkColorFilterImageFilter.cpp
diff --git a/src/effects/SkColorFilterImageFilter.cpp b/src/effects/SkColorFilterImageFilter.cpp
index 2a8df5c672109a4aee428e9801af6c305c0c89d4..ac5ea66586193b5ca74c1e53e7d722b7618dcbb6 100755
--- a/src/effects/SkColorFilterImageFilter.cpp
+++ b/src/effects/SkColorFilterImageFilter.cpp
@@ -62,7 +62,7 @@ SkColorFilterImageFilter* SkColorFilterImageFilter::Create(SkColorFilter* cf,
SkASSERT(cf);
SkScalar colorMatrix[20], inputMatrix[20];
SkColorFilter* inputColorFilter;
- if (input && cf->asColorMatrix(colorMatrix)
+ if (input && cf && cf->asColorMatrix(colorMatrix)
sugoi1 2014/10/29 15:26:12 SkColorFilterImageFilter's constructor calls SkSaf
reed1 2014/10/29 15:43:38 Does SkColorFilterImageFilter do anything if there
sugoi1 2014/10/29 18:21:00 Done.
&& input->asColorFilter(&inputColorFilter)
&& (inputColorFilter)) {
SkAutoUnref autoUnref(inputColorFilter);
@@ -141,7 +141,7 @@ bool SkColorFilterImageFilter::asColorFilter(SkColorFilter** filter) const {
if (!cropRectIsSet()) {
if (filter) {
*filter = fColorFilter;
- fColorFilter->ref();
+ SkSafeRef(fColorFilter);
sugoi1 2014/10/29 15:26:12 SkColorFilterImageFilter's constructor and destruc
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698