sw_engine: fix a composition crash issue.

Added an exceptional handling for out of buffer boundary.
This commit is contained in:
Hermet Park 2021-02-24 20:01:31 +09:00
parent 69ff5a484b
commit c0362cb69c

View file

@ -375,6 +375,9 @@ bool SwRenderer::beginComposite(Compositor* cmp, CompositeMethod method, uint32_
Compositor* SwRenderer::target(uint32_t x, uint32_t y, uint32_t w, uint32_t h) Compositor* SwRenderer::target(uint32_t x, uint32_t y, uint32_t w, uint32_t h)
{ {
//Out of boundary
if (x > surface->w || y > surface->h) return nullptr;
SwSurface* cmp = nullptr; SwSurface* cmp = nullptr;
//Use cached data //Use cached data