[FFmpeg-devel] [PATCH] checkasm/sw_rgb: fix buffer overflow
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Mon Jan 13 13:43:36 EET 2025
Niklas Haas:
> From: Niklas Haas <git at haasn.dev>
>
> Fixes: c601bb8df5ae
> Signed-off-by: Niklas Haas <git at haasn.dev>
> ---
> tests/checkasm/sw_rgb.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/checkasm/sw_rgb.c b/tests/checkasm/sw_rgb.c
> index 5714bfaa1e..042102fa73 100644
> --- a/tests/checkasm/sw_rgb.c
> +++ b/tests/checkasm/sw_rgb.c
> @@ -550,8 +550,8 @@ static void check_yuv2packed1(void)
> const int16_t *alpha;
>
> LOCAL_ALIGNED_8(int32_t, src_y, [INPUT_SIZE]);
> - LOCAL_ALIGNED_8(int32_t, src_u, [INPUT_SIZE]);
> - LOCAL_ALIGNED_8(int32_t, src_v, [INPUT_SIZE]);
> + LOCAL_ALIGNED_8(int32_t, src_u, [2 * INPUT_SIZE]);
> + LOCAL_ALIGNED_8(int32_t, src_v, [2 * INPUT_SIZE]);
> LOCAL_ALIGNED_8(int32_t, src_a, [INPUT_SIZE]);
>
> LOCAL_ALIGNED_8(uint8_t, dst0, [INPUT_SIZE * sizeof(int32_t[4])]);
Why are you declaring these arrays as arrays of int32_t, when the actual
values are int16_t? This is a recipe for effective-type violations (i.e.
strict-aliasing violations).
- Andreas
More information about the ffmpeg-devel
mailing list