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

Unified Diff: src/codec/SkPngCodec.cpp

Issue 2261173004: Fix MSAN - mark temporary memory as kNo_ZeroInitialized (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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: src/codec/SkPngCodec.cpp
diff --git a/src/codec/SkPngCodec.cpp b/src/codec/SkPngCodec.cpp
index 8f7ab79bf1f099df265e4c3796425cfa5ea22d6c..0d73ad03f4793a985447c6e26dc5fd5453c1796d 100644
--- a/src/codec/SkPngCodec.cpp
+++ b/src/codec/SkPngCodec.cpp
@@ -818,6 +818,7 @@ bool SkPngCodec::initializeXforms(const SkImageInfo& dstInfo, const Options& opt
// because the interlaced scanline decoder may need to rewind.
fColorXform = nullptr;
SkImageInfo swizzlerInfo = dstInfo;
+ Options swizzlerOptions = options;
bool needsColorXform = needs_color_xform(dstInfo, this->getInfo());
if (needsColorXform) {
switch (dstInfo.colorType()) {
@@ -841,6 +842,12 @@ bool SkPngCodec::initializeXforms(const SkImageInfo& dstInfo, const Options& opt
if (!fColorXform && kRGBA_F16_SkColorType == dstInfo.colorType()) {
return false;
}
+
+ // When there is a color xform, we swizzle into temporary memory, which is not
+ // zero initialized.
+ // FIXME (msarett):
+ // Is this a problem?
+ swizzlerOptions.fZeroInitialized = kNo_ZeroInitialized;
}
if (SkEncodedInfo::kPalette_Color == this->getEncodedInfo().color()) {
@@ -855,7 +862,7 @@ bool SkPngCodec::initializeXforms(const SkImageInfo& dstInfo, const Options& opt
// Create the swizzler. SkPngCodec retains ownership of the color table.
const SkPMColor* colors = get_color_ptr(fColorTable.get());
fSwizzler.reset(SkSwizzler::CreateSwizzler(this->getEncodedInfo(), colors, swizzlerInfo,
- options));
+ swizzlerOptions));
SkASSERT(fSwizzler);
return true;
}
« 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