mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 19:44:28 +00:00
sw_engine: fix an invalid memory access.
the surface and mesh data can be missed by an invalid condition. this fixes an invalid memory access problem. Issue: https://github.com/thorvg/thorvg/issues/1671
This commit is contained in:
parent
92b6f9dc48
commit
51c3a8912c
2 changed files with 3 additions and 4 deletions
|
@ -773,10 +773,8 @@ RenderData SwRenderer::prepare(Surface* surface, const RenderMesh* mesh, RenderD
|
|||
//prepare task
|
||||
auto task = static_cast<SwImageTask*>(data);
|
||||
if (!task) task = new SwImageTask;
|
||||
if (flags & RenderUpdateFlag::Image) {
|
||||
task->source = surface;
|
||||
task->mesh = mesh;
|
||||
}
|
||||
task->source = surface;
|
||||
task->mesh = mesh;
|
||||
return prepareCommon(task, transform, clips, opacity, flags);
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ exe_suffix = 'js'
|
|||
[built-in options]
|
||||
cpp_args = ['-Wshift-negative-value', '-flto', '-Os', '-fno-exceptions']
|
||||
cpp_link_args = ['-Wshift-negative-value', '-flto', '-Os', '-fno-exceptions', '--bind', '-sWASM=1', '-sALLOW_MEMORY_GROWTH=1', '-sFORCE_FILESYSTEM=1']
|
||||
#cpp_link_args = ['-Wshift-negative-value', '-flto', '-Os', '-fno-exceptions', '--bind', '-sWASM=1', '-sALLOW_MEMORY_GROWTH=1', '-sFORCE_FILESYSTEM=1', '-g'] //enable g flag for wasm debugging
|
||||
|
||||
[host_machine]
|
||||
system = 'emscripten'
|
||||
|
|
Loading…
Add table
Reference in a new issue