broadcom/cle: ensure zlib inflate assign memory

This basic assertion helps static analyzer to avoid complaining that the
data memory could be NULL when we copy data from there later.

This fixes static analyzer warning null pointer passed to 2nd parameter expecting 'nonnull'

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39577>
This commit is contained in:
Juan A. Suarez Romero 2026-01-28 11:33:13 +01:00 committed by Marge Bot
parent 5a85b3d9f4
commit 7bc1736006

View file

@ -672,6 +672,7 @@ v3d_spec_load(const struct v3d_device_info *devinfo)
sizeof(compress_genxmls),
(void **) &text_data);
assert(text_offset + text_length <= total_length);
assert(text_data);
buf = XML_GetBuffer(ctx.parser, text_length);
memcpy(buf, &text_data[text_offset], text_length);