Mesa (staging/20.0): vdpau: Fix wrong calloc sizeof argument.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 9 18:01:48 UTC 2020


Module: Mesa
Branch: staging/20.0
Commit: 8edafd6aae7d0b79dcbee416b5ead74deb05829e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8edafd6aae7d0b79dcbee416b5ead74deb05829e

Author: Vinson Lee <vlee at freedesktop.org>
Date:   Fri May 22 17:59:27 2020 -0700

vdpau: Fix wrong calloc sizeof argument.

Fix warning reported by Coverity Scan.

Wrong sizeof argument (SIZEOF_MISMATCH)
suspicious_sizeof: Passing argument 3544UL (sizeof
(vlVdpPresentationQueue)) to function calloc that returns a pointer of
type vlVdpPresentationQueueTarget * is suspicious because a multiple of
sizeof (vlVdpPresentationQueueTarget) /*16*/ is expected.

Fixes: 65fe0866aec7 ("vl: implemented a few functions and made stubs to get mplayer running")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3026
Signed-off-by: Vinson Lee <vlee at freedesktop.org>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5182>
(cherry picked from commit 8b353524b04fa9cd77e21e2d036c69f1cff30c35)

---

 .pick_status.json                         | 2 +-
 src/gallium/state_trackers/vdpau/device.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 92468732cfb..57ee9718302 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1093,7 +1093,7 @@
         "description": "vdpau: Fix wrong calloc sizeof argument.",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "65fe0866aec7b5608419f6d184cb1fa4fe1dc45a"
     },
diff --git a/src/gallium/state_trackers/vdpau/device.c b/src/gallium/state_trackers/vdpau/device.c
index 5df30ea3c08..f69c54c4536 100644
--- a/src/gallium/state_trackers/vdpau/device.c
+++ b/src/gallium/state_trackers/vdpau/device.c
@@ -170,7 +170,7 @@ vlVdpPresentationQueueTargetCreateX11(VdpDevice device, Drawable drawable,
    if (!dev)
       return VDP_STATUS_INVALID_HANDLE;
 
-   pqt = CALLOC(1, sizeof(vlVdpPresentationQueue));
+   pqt = CALLOC(1, sizeof(vlVdpPresentationQueueTarget));
    if (!pqt)
       return VDP_STATUS_RESOURCES;
 



More information about the mesa-commit mailing list