From 16a855ae6190e2e7edb9ebda9d9ab6a5eb37cecf Mon Sep 17 00:00:00 2001 From: Caleb Callaway Date: Mon, 28 Jul 2025 18:09:23 +0000 Subject: [PATCH] compiler: use PATH_MAX for SPIR-V capture filename Reviewed-by: Natalie Vock Part-of: --- src/compiler/spirv/spirv_to_nir.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index 2bf92b0991e..9a78bb08727 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -45,6 +45,10 @@ #include +#ifndef PATH_MAX +#define PATH_MAX 4096 +#endif + /* Table of all implemented capabilities. These are the capabilities that are * implemented in the spirv_to_nir, not what the device supports. * @@ -343,7 +347,7 @@ vtn_dump_shader(struct vtn_builder *b, const char *path, const char *prefix) { static int idx = 0; - char filename[1024]; + char filename[PATH_MAX]; int len = snprintf(filename, sizeof(filename), "%s/%s-%d.spirv", path, prefix, idx++); if (len < 0 || len >= sizeof(filename))