aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGert Wollny <gert.wollny@collabora.com>2022-11-08 17:48:29 +0100
committerMarge Bot <emma+marge@anholt.net>2022-11-10 07:03:02 +0000
commitade0e7e18c3b149f0b42babbbaa6e55a145edb3a (patch)
treecb6ae9bfd79a261474f726a3531137f82459762c
parent546bf7011765ba5dea9f14f9251e291281e9dc25 (diff)
downloadvirglrenderer-ade0e7e18c3b149f0b42babbbaa6e55a145edb3a.tar.gz
video: Allocate the right sized array
We want an array of unsigned, set the element size accordingly. Fixes Coverirty ID: 1527217 "Wrong sizeof argument" Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/975>
-rw-r--r--src/virgl_video.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/virgl_video.c b/src/virgl_video.c
index d7f5d921..025ce00c 100644
--- a/src/virgl_video.c
+++ b/src/virgl_video.c
@@ -463,7 +463,7 @@ static void encode_completed(struct virgl_video_codec *codec,
num_coded_bufs++;
coded_bufs = calloc(num_coded_bufs, sizeof(void *));
- coded_sizes = calloc(num_coded_bufs, sizeof(unsigned *));
+ coded_sizes = calloc(num_coded_bufs, sizeof(unsigned));
if (!coded_bufs || !coded_sizes) {
virgl_log("alloc memory failed, num_coded_bufs %u\n", num_coded_bufs);
goto fail_unmap_buffer;