From e16f68d89d1c4941e2b85020340061e0b61c823f Mon Sep 17 00:00:00 2001 From: Raph Levien Date: Tue, 26 May 2020 22:46:33 -0700 Subject: [PATCH] Fix buffer overrun Was a little too eager zeroing out sh_is_segment[] --- piet-gpu/shader/coarse.comp | 2 ++ piet-gpu/shader/coarse.spv | Bin 49152 -> 49152 bytes 2 files changed, 2 insertions(+) diff --git a/piet-gpu/shader/coarse.comp b/piet-gpu/shader/coarse.comp index 3a73417..1f73318 100644 --- a/piet-gpu/shader/coarse.comp +++ b/piet-gpu/shader/coarse.comp @@ -133,6 +133,8 @@ void main() { for (uint i = 0; i < N_SLICE; i++) { sh_bitmaps[i][th_ix] = 0; sh_backdrop[i][th_ix] = 0; + } + if (th_ix < N_SLICE) { sh_is_segment[th_ix] = 0; } diff --git a/piet-gpu/shader/coarse.spv b/piet-gpu/shader/coarse.spv index 56337efe2c287438514a7be4724992bd6a4f6b2b..d951b247c1f2e6116832ab6fbd677a0e3ef937c0 100644 GIT binary patch delta 17 YcmZo@U~Xt&-Z00ODTI0RJlmuu0638bTL1t6 delta 17 YcmZo@U~Xt&-Z00O=^4}JdA3PS06d8X>;M1&