skia2/include/utils
kkinnunen 297aaf97a3 Avoid wrong memory access due to double substitution and %%
Use the form SkDebugf("%s", arbitraryString) instead of
SkDebugf(arbitraryString).

Fixes the case where SkString::appendf-ing a string with "%%" and then
printing the string with SkDebugf would cause uninitialized read and
corrupted debug print.

ninja -C out/Debug tools && valgrind --leak-check=full
./out/Debug/render_pictures --config gpu  -w q -r ...

...

==7307== Conditional jump or move depends on uninitialised value(s)
==7307==    at 0x6908475: __printf_fp (printf_fp.c:1180)
==7307==    by 0x6904267: vfprintf (vfprintf.c:1629)
==7307==    by 0x6906E53: buffered_vfprintf (vfprintf.c:2313)
==7307==    by 0x690188D: vfprintf (vfprintf.c:1316)
==7307==    by 0x67E8F5: SkDebugf(char const*, ...) (SkDebug_stdio.cpp:18)
==7307==    by 0x7983F1: GrContext::printCacheStats() const (GrTest.cpp:54)
==7307==    by 0x408ECF: tool_main(int, char**) (render_pictures_main.cpp:480)
==7307==    by 0x40913E: main (render_pictures_main.cpp:511)
==7307==
Budget: 2048 items 100663296 bytes
		Entry Count: current 652 (651 budgeted, 0 wrapped, 297 locked, 638 scratch 32 0.000000ull), high 652
		Entry Bytes: current 51087658 (budgeted 49826658, 49 0.000000ull, 1261000 unbudgeted) high 51087658

(observe "ull" instead of "% full")

(from mtklein)
This CL is not editing public API.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/943453002
2015-02-19 06:32:12 -08:00
..
ios Drop executable flag from headers so that they can be packaged 2014-03-11 19:55:51 +00:00
mac Make SkStream *not* ref counted. 2015-01-21 12:09:53 -08:00
win Fix SkIStream nits. 2015-01-22 07:33:51 -08:00
SkBoundaryPatch.h Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SkCamera.h Enable unused param checking for public includes. 2014-11-14 11:11:46 -08:00
SkCanvasStateUtils.h Turn SkCanvasStateUtils into a class with static functions. 2014-10-10 06:19:09 -07:00
SkCubicInterval.h Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SkCullPoints.h Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:09:54 +00:00
SkDebugUtils.h Avoid wrong memory access due to double substitution and %% 2015-02-19 06:32:12 -08:00
SkDeferredCanvas.h Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SkDumpCanvas.h Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SkEventTracer.h rename tracing parameter to be more consistent with other methods 2014-02-03 19:47:13 +00:00
SkFrontBufferedStream.h Make SkStream *not* ref counted. 2015-01-21 12:09:53 -08:00
SkInterpolator.h Promote SkInterpolator unit test to our tests driver. 2014-06-26 13:07:05 -07:00
SkJSONCPP.h upstream google3 include paths for jsoncpp 2015-01-14 05:02:39 -08:00
SkLayer.h Extended Inst counting to find "unknown" leaked object (SkTMaskGamma) 2012-08-16 14:58:06 +00:00
SkLua.h SkTextBlob plumbing 2014-08-26 07:56:44 -07:00
SkLuaCanvas.h Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SkMatrix44.h Add isScale() helper function to SkMatrix44. 2014-10-24 08:07:05 -07:00
SkMeshUtils.h Start cleaning up 64bit Win warnings 2013-10-14 21:53:24 +00:00
SkNinePatch.h Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:09:54 +00:00
SkNoSaveLayerCanvas.h Introduce Props to surface (patchset #27 id:520001 of https://codereview.chromium.org/551463004/)" 2014-09-22 07:29:03 -07:00
SkNullCanvas.h Add SK_API to null canvas create method 2012-06-11 15:41:25 +00:00
SkNWayCanvas.h Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SkParse.h Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SkParsePaint.h Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SkParsePath.h Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SkPathUtils.h Animated the PathUtils Sample to show path contours# Enter a description of the change. 2013-07-09 16:30:38 +00:00
SkPictureUtils.h remove (unused) GatherPixelRefs 2015-01-22 09:03:25 -08:00
SkRandom.h There can be only one (SkRandom)! 2014-12-15 12:54:51 -08:00
SkRTConf.h Migrate SkRTConfRegistry test to DEF_TEST(). 2014-08-12 09:03:16 -07:00
SkTextBox.h add textblobs to lua 2014-11-03 19:55:41 -08:00