util/format: initialize non-important components to 0
Avoids copying random garbage from the stack. Found by Coverity. Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6067>
This commit is contained in:

committed by
Marge Bot

parent
f13042ec7e
commit
28f2585365
@@ -593,7 +593,7 @@ def generate_pack_kernel(format, src_channel, src_native_type):
|
||||
def pack_into_struct(channels, swizzles):
|
||||
inv_swizzle = inv_swizzles(swizzles)
|
||||
|
||||
print(' struct util_format_%s pixel;' % format.short_name())
|
||||
print(' struct util_format_%s pixel = {0};' % format.short_name())
|
||||
|
||||
for i in range(4):
|
||||
dst_channel = channels[i]
|
||||
|
Reference in New Issue
Block a user