From ef5b8dc96a6cdf36ab8d7eb37a2a6e60d20c9f47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 28 Mar 2024 19:49:46 +0000 Subject: [PATCH] tests: rtpred: fix out-of-bound writes Don't write more data to the buffer than we allocated space for. Fixes #3312 Part-of: --- subprojects/gst-plugins-good/tests/check/elements/rtpred.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-good/tests/check/elements/rtpred.c b/subprojects/gst-plugins-good/tests/check/elements/rtpred.c index 99b08fdd7a..80dd2715f5 100644 --- a/subprojects/gst-plugins-good/tests/check/elements/rtpred.c +++ b/subprojects/gst-plugins-good/tests/check/elements/rtpred.c @@ -398,7 +398,7 @@ GST_START_TEST (rtpreddec_invalid) bufinp = _new_rtp_buffer (FALSE, 0, PT_RED, 1, TIMESTAMP_NTH (1), 0xabe2b0b, 1); fail_unless (gst_rtp_buffer_map (bufinp, GST_MAP_WRITE, &rtp)); - memcpy (gst_rtp_buffer_get_payload (&rtp), &data, sizeof (data)); + memcpy (gst_rtp_buffer_get_payload (&rtp), &data, 1); gst_rtp_buffer_unmap (&rtp); _push_and_check_didnt_go_through (h, bufinp); @@ -406,7 +406,7 @@ GST_START_TEST (rtpreddec_invalid) bufinp = _new_rtp_buffer (FALSE, 0, PT_RED, 2, TIMESTAMP_NTH (2), 0xabe2b0b, 4); fail_unless (gst_rtp_buffer_map (bufinp, GST_MAP_WRITE, &rtp)); - memcpy (gst_rtp_buffer_get_payload (&rtp), &data, sizeof (data)); + memcpy (gst_rtp_buffer_get_payload (&rtp), &data, 4); gst_rtp_buffer_unmap (&rtp); _push_and_check_didnt_go_through (h, bufinp);