Changeset 280601 in webkit
- Timestamp:
- Aug 3, 2021, 10:34:48 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/webgl/webgl-oom-paint-document-no-crash-expected.html (added)
-
LayoutTests/webgl/webgl-oom-paint-document-no-crash.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r280599 r280601 1 2021-08-03 Kimmo Kinnunen <kkinnunen@apple.com> 2 3 Crash while reading WebGL drawing buffer if canvas image buffer allocation fails 4 https://bugs.webkit.org/show_bug.cgi?id=228737 5 <rdar://81150042> 6 7 Reviewed by Brent Fulgham. 8 9 Add a test for failure to paint the WebGL canvas to document. 10 Trigger the mode by using printing. 11 12 Other code-paths that invoke CanvasBase::makeRenderingResultsAvailable, 13 e.g. toDataURL and drawImage will check for the buffer before, and 14 as such are not testable in the sense that adding the test would trigger 15 the bug. 16 17 * webgl/webgl-oom-paint-document-no-crash-expected.html: Added. 18 * webgl/webgl-oom-paint-document-no-crash.html: Added. 19 1 20 2021-08-03 Antti Koivisto <antti@apple.com> 2 21 -
trunk/Source/WebCore/ChangeLog
r280599 r280601 1 2021-08-03 Kimmo Kinnunen <kkinnunen@apple.com> 2 3 Crash while reading WebGL drawing buffer if canvas image buffer allocation fails 4 https://bugs.webkit.org/show_bug.cgi?id=228737 5 <rdar://81150042> 6 7 Reviewed by Brent Fulgham. 8 9 The crash would happen for example when running out of memory during snapshot 10 or printing. Snapshots and printing forces the WebGL canvas to be "painted 11 to document", which would then trigger the crash. 12 13 Other code-paths that invoke CanvasBase::makeRenderingResultsAvailable, 14 e.g. toDataURL and drawImage will check for the buffer before, and 15 as such are not testable in the sense that adding the test would trigger 16 the bug. 17 18 Test: webgl/webgl-oom-paint-document-no-crash.html 19 20 * html/canvas/WebGLRenderingContextBase.cpp: 21 (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas): 22 Check for the nullptr from CanvasBase::buffer(). This might happen 23 when the ImageBuffer was not allocated due to memory constraints. 24 1 25 2021-08-03 Antti Koivisto <antti@apple.com> 2 26 -
trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
r280587 r280601 1219 1219 base.clearCopiedImage(); 1220 1220 m_markedCanvasDirty = false; 1221 // FIXME: Remote ImageBuffers do not flush the buffers that are drawn to a buffer. 1222 // Avoid leaking the WebGL content in the cases where a WebGL canvas element is drawn to a Context2D 1223 // canvas element repeatedly. 1224 base.buffer()->flushDrawingContext(); 1225 m_context->paintCompositedResultsToCanvas(*base.buffer()); 1221 if (auto buffer = base.buffer()) { 1222 // FIXME: Remote ImageBuffers do not flush the buffers that are drawn to a buffer. 1223 // Avoid leaking the WebGL content in the cases where a WebGL canvas element is drawn to a Context2D 1224 // canvas element repeatedly. 1225 buffer->flushDrawingContext(); 1226 m_context->paintCompositedResultsToCanvas(*buffer); 1227 } 1226 1228 } 1227 1229 return; … … 1237 1239 1238 1240 m_markedCanvasDirty = false; 1239 // FIXME: Remote ImageBuffers do not flush the buffers that are drawn to a buffer. 1240 // Avoid leaking the WebGL content in the cases where a WebGL canvas element is drawn to a Context2D 1241 // canvas element repeatedly. 1242 base.buffer()->flushDrawingContext(); 1243 m_context->paintRenderingResultsToCanvas(*base.buffer()); 1241 if (auto buffer = base.buffer()) { 1242 // FIXME: Remote ImageBuffers do not flush the buffers that are drawn to a buffer. 1243 // Avoid leaking the WebGL content in the cases where a WebGL canvas element is drawn to a Context2D 1244 // canvas element repeatedly. 1245 buffer->flushDrawingContext(); 1246 m_context->paintRenderingResultsToCanvas(*buffer); 1247 } 1244 1248 } 1245 1249
Note:
See TracChangeset
for help on using the changeset viewer.