diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2026-09-29 00:50:18 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2026-10-01 13:29:27 +0200 |
| commit | 0baff0247e58fd06ea97a60ece8cd0ec635c94b5 (patch) | |
| tree | 33996cd9aaced44f2c1bcf20b7cf2bcf1ece9104 | |
| parent | 2306cd2d9ac4796cbefe841f05a006b6f44c007e (diff) | |
0 memory leaks
| -rw-r--r-- | shaders/vkvg_main.frag | 2 | ||||
| -rw-r--r-- | shaders/vkvg_main.vert | 6 | ||||
| -rw-r--r-- | src/vkvg_device.c | 3 | ||||
| -rw-r--r-- | tests/svg-parser-new/svg-parse.c | 3 |
4 files changed, 9 insertions, 5 deletions
diff --git a/shaders/vkvg_main.frag b/shaders/vkvg_main.frag index 8fe108d..7bcfb41 100644 --- a/shaders/vkvg_main.frag +++ b/shaders/vkvg_main.frag @@ -72,7 +72,7 @@ void main() case SURFACE: vec2 p = (gl_FragCoord.xy - inSrc.xy); vec2 uv = vec2( - inMat[0][0] * p.x + inMat[1][0] * p.y + inMat[2][0], + inMat[0][0] * p.x + inMat[1][0] * p.y + inMat[2][0], inMat[0][1] * p.x + inMat[1][1] * p.y + inMat[2][1] ); uv /= inSrc.zw; diff --git a/shaders/vkvg_main.vert b/shaders/vkvg_main.vert index 104a3d2..6faacaa 100644 --- a/shaders/vkvg_main.vert +++ b/shaders/vkvg_main.vert @@ -41,7 +41,7 @@ layout (location = 4) out mat3x2 outMat; layout(push_constant) uniform PushConsts { vec4 source; vec2 size; - int fullScreenQuad_srcType; + int fullScreenQuad_srcType; float opacity; mat3x2 mat; mat3x2 matInv; @@ -72,8 +72,8 @@ void main() outUV = inUV; vec2 p = vec2( - pc.mat[0][0] * inPos.x + pc.mat[1][0] * inPos.y + pc.mat[2][0], - pc.mat[0][1] * inPos.x + pc.mat[1][1] * inPos.y + pc.mat[2][1] + pc.mat[0][0] * inPos.x + pc.mat[1][0] * inPos.y + pc.mat[2][0], + pc.mat[0][1] * inPos.x + pc.mat[1][1] * inPos.y + pc.mat[2][1] ); gl_Position = vec4(p * vec2(2) / pc.size - vec2(1), 0.0, 1.0); diff --git a/src/vkvg_device.c b/src/vkvg_device.c index 1784951..25d4482 100644 --- a/src/vkvg_device.c +++ b/src/vkvg_device.c @@ -225,6 +225,7 @@ vkvg_status_t vkvg_get_required_device_extensions(VkPhysicalDevice phy, const ch if (!scalarBlockLayoutSupport.scalarBlockLayout) { LOG(VKVG_LOG_ERR, "CREATE Device failed, vkvg compiled with VKVG_ENABLE_VK_SCALAR_BLOCK_LAYOUT and feature is " "not implemented for physical device.\n"); + free(pExtensionProperties); return VKVG_STATUS_DEVICE_ERROR; } _CHECK_DEV_EXT(VK_EXT_scalar_block_layout) @@ -232,12 +233,14 @@ vkvg_status_t vkvg_get_required_device_extensions(VkPhysicalDevice phy, const ch #ifdef VKVG_ENABLE_VK_TIMELINE_SEMAPHORE if (!timelineSemaphoreSupport.timelineSemaphore) { LOG(VKVG_LOG_ERR, "CREATE Device failed, VK_SEMAPHORE_TYPE_TIMELINE not supported.\n"); + free(pExtensionProperties); return VKVG_STATUS_DEVICE_ERROR; } _CHECK_DEV_EXT(VK_KHR_timeline_semaphore) #endif _CHECK_DEV_EXT(VK_EXT_extended_dynamic_state) + free(pExtensionProperties); return VKVG_STATUS_SUCCESS; } diff --git a/tests/svg-parser-new/svg-parse.c b/tests/svg-parser-new/svg-parse.c index 82db82f..678a200 100644 --- a/tests/svg-parser-new/svg-parse.c +++ b/tests/svg-parser-new/svg-parse.c @@ -185,7 +185,8 @@ float b = (float)((stop->color & 0x00ff0000) >> 16) / 255.0f; \ float g = (float)((stop->color & 0x0000ff00) >> 8) / 255.0f; \ float r = (float)(stop->color & 0x000000ff) / 255.0f; \ - vkvg_pattern_add_color_stop(pat, stop->offset, r, g, b, a * stop->opacity); + vkvg_pattern_add_color_stop(pat, stop->offset, r, g, b, a * stop->opacity); \ + free(stop); #define SVG_ATT_STOP_COLOR \ svg_paint_type enabled; \ |