Module: Mesa Branch: master Commit: 319158a814ae0833573d5e4ff7150504aebae59b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=319158a814ae0833573d5e4ff7150504aebae59b
Author: Icecream95 <[email protected]> Date: Wed Apr 1 15:32:19 2020 +1300 pan/midgard: Fix a divide by zero in emit_alu_bundle util_dynarray_grow_bytes divides by eltsize, but it's possible for bundle->padding to be zero. I changed the other call to util_dynarray_grow_bytes for consistency. Reviewed-by: Alyssa Rosenzweig <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4397> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4397> --- src/panfrost/midgard/midgard_emit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/panfrost/midgard/midgard_emit.c b/src/panfrost/midgard/midgard_emit.c index 2b18aac3553..0c5d60efa4a 100644 --- a/src/panfrost/midgard/midgard_emit.c +++ b/src/panfrost/midgard/midgard_emit.c @@ -372,11 +372,11 @@ emit_alu_bundle(compiler_context *ctx, source = &scalarized; } - memcpy(util_dynarray_grow_bytes(emission, 1, size), source, size); + memcpy(util_dynarray_grow_bytes(emission, size, 1), source, size); } /* Emit padding (all zero) */ - memset(util_dynarray_grow_bytes(emission, 1, bundle->padding), 0, bundle->padding); + memset(util_dynarray_grow_bytes(emission, bundle->padding, 1), 0, bundle->padding); /* Tack on constants */ _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
