gallivm: fix default cbuf info.
authorRoland Scheidegger <sroland@vmware.com>
Fri, 24 May 2019 00:41:12 +0000 (02:41 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Fri, 24 May 2019 17:22:50 +0000 (19:22 +0200)
The default null_output really needs to be static, otherwise the values
we'll eventually get later are doubly random (they are not initialized,
and even if they were it's a pointer to a local stack variable).
VMware bug 2349556.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_tgsi_info.c

index b4e3c2fbc8461cac171c3e781ba89f064988f80a..9fc9b8c77ecd30cb97fae4885c49e5c309444acf 100644 (file)
@@ -608,7 +608,7 @@ finished:
     */
 
    for (index = 0; index < PIPE_MAX_COLOR_BUFS; ++index) {
-      const struct lp_tgsi_channel_info null_output[4];
+      static const struct lp_tgsi_channel_info null_output[4];
       info->cbuf[index] = null_output;
    }