vdpau: Fix wrong calloc sizeof argument.
authorVinson Lee <vlee@freedesktop.org>
Sat, 23 May 2020 00:59:27 +0000 (17:59 -0700)
committerVinson Lee <vlee@freedesktop.org>
Thu, 4 Jun 2020 00:01:47 +0000 (17:01 -0700)
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@freedesktop.org>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5182>

src/gallium/frontends/vdpau/device.c

index 5df30ea3c089f3c67d179f97562d22ef4ace650a..f69c54c45368ee01e9a8b1b7e7e14aa7c74b3703 100644 (file)
@@ -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;