From 4484719443d0c1390b75d54e2bbf113ef3038e5f Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Fri, 4 Jul 2025 19:18:54 +0000
Subject: [PATCH] Fix memory leak when vkd3d-utils is missing or too old (#156)
* Fix memory leak when vkd3d-utils is missing or too old
* ci: windows-2019 is EOL
---
.github/workflows/main.yml | 2 +-
src/SDL_shadercross.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index bcd1855..7f1b5e6 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
platform:
- - { name: Windows (MSVC), os: windows-2019, build-spirv-cross: true, vendored: false, shell: sh, msvc: true, artifact: 'SDL3_shadercross-VC-x64' }
+ - { name: Windows (MSVC), os: windows-latest, build-spirv-cross: true, vendored: false, shell: sh, msvc: true, artifact: 'SDL3_shadercross-VC-x64' }
- { name: Windows (mingw64), os: windows-latest, build-spirv-cross: false, vendored: false, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64, artifact: 'SDL3_shadercross-mingw64' }
- { name: Ubuntu 22.04, os: ubuntu-22.04, build-spirv-cross: true, vendored: false, shell: sh, artifact: 'SDL3_shadercross-linux-x64' }
- { name: Steam Linux Runtime (Sniper), os: ubuntu-latest, build-spirv-cross: false, vendored: true, shell: sh, artifact: 'SDL3_shadercross-slrsniper', container: 'registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest' }
diff --git a/src/SDL_shadercross.c b/src/SDL_shadercross.c
index 66270c8..a5f9a9f 100644
--- a/src/SDL_shadercross.c
+++ b/src/SDL_shadercross.c
@@ -796,6 +796,7 @@ void *SDL_ShaderCross_INTERNAL_CompileDXBCFromHLSL(
info->enable_debug);
if (blob == NULL) {
+ SDL_free(transpiledSource);
*size = 0;
return NULL;
}