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

Unified Diff: src/effects/SkColorMatrixFilter.cpp

Issue 106943002: Fixed a few places where uninitialized memory could have been read (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Removed bad scalar checks in SkColorMatrixFilter.cpp Created 7 years 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
« no previous file with comments | « src/effects/SkColorFilters.cpp ('k') | src/effects/SkMergeImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkColorMatrixFilter.cpp
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index 5b36a8f7e55df1dec60b77de2b29ba6fa81aec39..fc1b77b7d5e27f4f6ffbe4bf5ae2718daf3726d2 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -308,10 +308,8 @@ void SkColorMatrixFilter::flatten(SkFlattenableWriteBuffer& buffer) const {
SkColorMatrixFilter::SkColorMatrixFilter(SkFlattenableReadBuffer& buffer)
: INHERITED(buffer) {
SkASSERT(buffer.getArrayCount() == 20);
- buffer.readScalarArray(fMatrix.fMat, 20);
- this->initState(fMatrix.fMat);
- for (int i = 0; i < 20; ++i) {
- buffer.validate(SkScalarIsFinite(fMatrix.fMat[i]));
sugoi1 2013/12/06 18:39:04 I didn't find anything obviously wrong with removi
+ if (buffer.readScalarArray(fMatrix.fMat, 20)) {
+ this->initState(fMatrix.fMat);
}
}
« no previous file with comments | « src/effects/SkColorFilters.cpp ('k') | src/effects/SkMergeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698