skia2/include
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
..
animator Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
c add stroke params to c api 2015-01-10 17:59:31 -08:00
config SK_NO_FLATE 2015-02-17 13:10:43 -08:00
core Pass Rendertarget into context. 2015-02-18 12:29:52 -08:00
device/xps Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
effects Fix SkComposeImageFilter's bounds computation and offset handling 2015-02-13 09:05:47 -08:00
gpu Pass Rendertarget into context. 2015-02-18 12:29:52 -08:00
images Make SkStream *not* ref counted. 2015-01-21 12:09:53 -08:00
pathops add pathops tight bounds; conform path ops' gyp to unit tests 2014-06-24 07:55:12 -07:00
pdf use common impl for drawTextOnPath 2015-02-17 10:33:54 -08:00
pipe "NULL !=" = NULL 2014-09-05 13:34:00 -07:00
ports Expose method to retrieve CTFont 2015-02-18 10:50:58 -08:00
svg Add SkSVGCanvas 2015-02-06 12:51:10 -08:00
utils Avoid wrong memory access due to double substitution and %% 2015-02-19 06:32:12 -08:00
views First cut at cleaning up Sergio's example code and moving some common code to SkWindow. 2015-01-30 12:37:02 -08:00
xml add length parameter to addText, to match attr values 2015-02-04 18:29:27 -08:00