Mesa (master): panfrost: Avoid overlapping copy
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Feb 4 07:41:27 UTC 2020
Module: Mesa
Branch: master
Commit: 8ec4028d4057da19708b4f4bce88ee16f96f322a
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ec4028d4057da19708b4f4bce88ee16f96f322a
Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date: Mon Feb 3 14:28:18 2020 -0500
panfrost: Avoid overlapping copy
CID 1457486: Memory - corruptions (OVERLAPPING_COPY)
Assigning "(*attr).extra_flags = (*attr).size = 0U" to "(*attr).stride",
which have overlapping memory +locations.
Coverity.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3684>
---
src/panfrost/encoder/pan_attributes.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/panfrost/encoder/pan_attributes.c b/src/panfrost/encoder/pan_attributes.c
index d15ed9c1ea1..d4c8ab6e8ad 100644
--- a/src/panfrost/encoder/pan_attributes.c
+++ b/src/panfrost/encoder/pan_attributes.c
@@ -202,7 +202,9 @@ panfrost_instance_id(
union mali_attr *attr)
{
attr->elements = MALI_ATTR_INSTANCEID;
- attr->stride = attr->extra_flags = attr->size = 0;
+ attr->stride = 0;
+ attr->extra_flags = 0;
+ attr->size = 0;
/* POT records have just a shift directly with an off-by-one for
* unclear reasons. NPOT records have a magic divisor smushed into the
More information about the mesa-commit
mailing list