[virglrenderer-devel] [PATCH 5/8] make arrayname size a big larger
Dave Airlie
airlied at gmail.com
Mon May 21 03:07:26 UTC 2018
From: Dave Airlie <airlied at redhat.com>
[addr%d] could in theory be [addr65536] so needs a few more bytes.
Fixes warning:
vrend_shader.c: In function ‘iter_instruction’:
vrend_shader.c:1861:38: warning: ‘%d’ directive writing between 1 and 6 bytes into a region of size 4 [-Wformat-overflow=]
sprintf(arrayname, "[addr%d]", src->DimIndirect.Index);
^~
vrend_shader.c:1861:32: note: directive argument in the range [-32768, 32767]
sprintf(arrayname, "[addr%d]", src->DimIndirect.Index);
^~~~~~~~~~
vrend_shader.c:1861:13: note: ‘sprintf’ output between 8 and 13 bytes into a destination of size 9
sprintf(arrayname, "[addr%d]", src->DimIndirect.Index);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
src/vrend_shader.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/vrend_shader.c b/src/vrend_shader.c
index 83d45e3..0cfdd5c 100644
--- a/src/vrend_shader.c
+++ b/src/vrend_shader.c
@@ -1842,7 +1842,7 @@ iter_instruction(struct tgsi_iterate_context *iter,
const struct tgsi_full_src_register *src = &inst->Src[i];
char swizzle[8] = {0};
char prefix[6] = {0};
- char arrayname[9] = {0};
+ char arrayname[16] = {0};
int swz_idx = 0, pre_idx = 0;
boolean isabsolute = src->Register.Absolute;
--
2.14.3
More information about the virglrenderer-devel
mailing list