Changeset 139144 in webkit
- Timestamp:
- Jan 8, 2013 6:30:03 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r139143 r139144 1 2013-01-08 Justin Novosad <junov@google.com> 2 3 CanvasRenderingContext2D::setFont argument may reference destroyed object 4 https://bugs.webkit.org/show_bug.cgi?id=106385 5 6 Reviewed by Abhishek Arya. 7 8 No new tests: covered by fast/canvas/canvas-measureText.html 9 10 This is a re-write of r138994. Fixing bug in setFont instead of 11 workaround at call site. 12 13 * html/canvas/CanvasRenderingContext2D.cpp: 14 (WebCore::CanvasRenderingContext2D::setFont): 15 (WebCore::CanvasRenderingContext2D::accessFont): 16 1 17 2013-01-08 David Grogan <dgrogan@chromium.org> 2 18 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r138994 r139144 2089 2089 2090 2090 // The parse succeeded. 2091 realizeSaves(); 2092 modifiableState().m_unparsedFont = newFont; 2091 String newFontSafeCopy(newFont); // Create a string copy since newFont can be deleted inside realizeSaves. 2092 realizeSaves(); 2093 modifiableState().m_unparsedFont = newFontSafeCopy; 2093 2094 2094 2095 // Map the <canvas> font into the text style. If the font uses keywords like larger/smaller, these will work … … 2374 2375 canvas()->document()->updateStyleIfNeeded(); 2375 2376 2376 if (!state().m_realizedFont) { 2377 // Create temporary string object to hold ref count in case 2378 // state().m_unparsedFont in unreffed by call to realizeSaves in 2379 // setFont. 2380 String unparsedFont(state().m_unparsedFont); 2381 setFont(unparsedFont); 2382 } 2377 if (!state().m_realizedFont) 2378 setFont(state().m_unparsedFont); 2383 2379 return state().m_font; 2384 2380 }
Note: See TracChangeset
for help on using the changeset viewer.