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

Unified Diff: third_party/WebKit/WebCore/platform/graphics/chromium/UniscribeHelper.cpp

Issue 17225: Mask a UMR caused by ScriptShape. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 11 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: third_party/WebKit/WebCore/platform/graphics/chromium/UniscribeHelper.cpp
===================================================================
--- third_party/WebKit/WebCore/platform/graphics/chromium/UniscribeHelper.cpp (revision 7643)
+++ third_party/WebKit/WebCore/platform/graphics/chromium/UniscribeHelper.cpp (working copy)
@@ -523,6 +523,25 @@
shaping.m_glyphs.resize(numGlyphs);
shaping.m_visattr.resize(numGlyphs);
+#ifdef PURIFY
+ // http://code.google.com/p/chromium/issues/detail?id=5309
+ // Purify isn't able to track the assignments that ScriptShape makes to
+ // shaping.m_glyphs. Consequently any bytes with value 0xCD that it
+ // writes, will be considered un-initialized data.
+ //
+ // This hack avoid the false-positive UMRs by marking the buffer as
+ // initialized.
+ //
+ // TODO: A better solution would be to use Purify's API and mark only
+ // the populated range as initialized:
+ //
+ // PurifyMarkAsInitialized(
+ // &shaping.m_glyphs[0],
+ // sizeof(shaping.m_glyphs[0] * generatedGlyphs);
+ ZeroMemory(&shaping.m_glyphs[0],
+ sizeof(shaping.m_glyphs[0]) * shaping.m_glyphs.size());
+#endif
+
// Firefox sets SCRIPT_ANALYSIS.SCRIPT_STATE.fDisplayZWG to true
// here. Is that what we want? It will display control characters.
hr = ScriptShape(tempDC, scriptCache, input, itemLength,
« 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