From 4ac9eb549dccb982ea688fbfa4b79d47574a095e Mon Sep 17 00:00:00 2001 From: Alan Liddell Date: Fri, 5 Jul 2024 20:42:29 -0400 Subject: [PATCH] Fix bug in test_average_frame_inner --- src/zarr.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/zarr.cpp b/src/zarr.cpp index fbe912ce..b9483eaa 100644 --- a/src/zarr.cpp +++ b/src/zarr.cpp @@ -690,8 +690,12 @@ template void test_average_frame_inner(const SampleType& stype) { - auto* src = (VideoFrame*)malloc(sizeof(VideoFrame) + 9 * sizeof(T)); - src->bytes_of_frame = common::align_up(sizeof(*src) + 9 * sizeof(T), 8); + const size_t bytes_of_frame = + common::align_up(sizeof(VideoFrame) + 9 * sizeof(T), 8); + auto* src = (VideoFrame*)malloc(bytes_of_frame); + CHECK(src); + + src->bytes_of_frame = bytes_of_frame; src->shape = { .dims = { .channels = 1,