Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speculative fix for RemoveRenderPassResource() crash
SkiaOutputSurfaceImplOnGpu::RemoveRenderPassResource() assumes that every RenderPassId exists in the |offscreen_surfaces_| map. If drawing the RenderPass fails before SOSIOG::FinishPaintRenderPass() adds a map entry, then the iterator in SOSIOG::RemoveRenderPassResource() will point to offscreen_surfaces_.end(). Calling flat_map::erase() with the end iterator is an error. SkiaOutputSurfaceImpl::SubmitPaint() assumes that SOSIOnGpu::FinishPaintRenderPass() will be successful. However if the context is lost in FinishPaintRenderPass() it will return early and not added a map entry. Both SkiaRenderer and SkiaOutputSurfaceImpl will think there are RenderPass resources to delete leading to a potential crash. This is a speculative fix as I'm unable to reproduce it locally. Bug: 1015613 Change-Id: Icd8f6922926892ccecb973041f5a626e75f78771 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1914298 Reviewed-by: Jonathan Backer <backer@chromium.org> Commit-Queue: kylechar <kylechar@chromium.org> Cr-Commit-Position: refs/heads/master@{#715057}
- Loading branch information