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

Unified Diff: tests/BitmapCopyTest.cpp

Issue 26890002: Fix uninitialized memory read in BitmapCopy test with A1 config (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Switched to use getSafeSize Created 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/BitmapCopyTest.cpp
===================================================================
--- tests/BitmapCopyTest.cpp (revision 11697)
+++ tests/BitmapCopyTest.cpp (working copy)
@@ -57,6 +57,10 @@
if (bitmap.getPixels()) {
if (bitmap.getColorTable()) {
sk_bzero(bitmap.getPixels(), bitmap.getSize());
+ } else if (SkBitmap::kA1_Config == bitmap.config()) {
+ // The A1 config can have uninitialized bits at the
+ // end of each row if eraseColor is used
+ memset(bitmap.getPixels(), 0xff, bitmap.getSafeSize());
} else {
bitmap.eraseColor(SK_ColorWHITE);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698