Chromium Code Reviews| Index: src/effects/SkColorFilterImageFilter.cpp |
| diff --git a/src/effects/SkColorFilterImageFilter.cpp b/src/effects/SkColorFilterImageFilter.cpp |
| index 2a8df5c672109a4aee428e9801af6c305c0c89d4..b9afbf06404f69a1b797fbcbd2ce9eac5734b343 100755 |
| --- a/src/effects/SkColorFilterImageFilter.cpp |
| +++ b/src/effects/SkColorFilterImageFilter.cpp |
| @@ -60,6 +60,9 @@ bool matrix_needs_clamping(SkScalar matrix[20]) { |
| SkColorFilterImageFilter* SkColorFilterImageFilter::Create(SkColorFilter* cf, |
| SkImageFilter* input, const CropRect* cropRect, uint32_t uniqueID) { |
| SkASSERT(cf); |
| + if (NULL == cf) { |
| + return NULL; |
| + } |
| SkScalar colorMatrix[20], inputMatrix[20]; |
| SkColorFilter* inputColorFilter; |
| if (input && cf->asColorMatrix(colorMatrix) |
| @@ -141,7 +144,7 @@ bool SkColorFilterImageFilter::asColorFilter(SkColorFilter** filter) const { |
| if (!cropRectIsSet()) { |
| if (filter) { |
| *filter = fColorFilter; |
| - fColorFilter->ref(); |
| + SkSafeRef(fColorFilter); |
|
reed1
2014/10/29 18:27:08
When can this ever be NULL?
sugoi1
2014/10/29 18:30:58
I was just trying to be consistent with constructo
|
| } |
| return true; |
| } |