mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-24 23:28:57 +00:00
sw_engine: added check whether surface width <= surface stride
In a case width > stride segf occured. Such a case should be treated as an invalid arg.
This commit is contained in:
parent
5c26014e2f
commit
f3fac71a12
1 changed files with 1 additions and 1 deletions
|
@ -277,7 +277,7 @@ bool SwRenderer::viewport(const RenderRegion& vp)
|
|||
|
||||
bool SwRenderer::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h, uint32_t cs)
|
||||
{
|
||||
if (!buffer || stride == 0 || w == 0 || h == 0) return false;
|
||||
if (!buffer || stride == 0 || w == 0 || h == 0 || w > stride) return false;
|
||||
|
||||
if (!surface) {
|
||||
surface = new SwSurface;
|
||||
|
|
Loading…
Add table
Reference in a new issue