Fix poison address in blink::CanvasResourceHost::InitializeForRecording
After allocate a large buffer in memory and creating canvas, it will trigger the garbage collection from v8, which will trigger HtmlCanvasElement::Dispose to be called. This call will cause the canvas element detached from the |host|. However the |host| is saved as a valid callback in the observer list of the canvas resource provider. Calling this |host| without canvas element causes this access to poison address. In my fix, after garbage collection is triggered and dispose is called, DiscardResourceProvider() is called as well, so it removes itself from the observer list. Bug: 1158266 Change-Id: I40bfc24ff5dcdb7a248114220100b6dd54ac06f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2595734 Commit-Queue: Jeremy Roman <jbroman@chromium.org> Commit-Queue: Yi Xu <yiyix@chromium.org> Reviewed-by:Jeremy Roman <jbroman@chromium.org> Cr-Commit-Position: refs/heads/master@{#838228}
Showing
Please register or sign in to comment