summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2024-03-28 19:49:46 +0000
committerTim-Philipp Müller <tim@centricular.com>2024-03-29 00:22:57 +0000
commit37bacb49a9629571f60bb3a31efd05238a27825b (patch)
tree45ceddf234c2bc5253f18ec9e690ce87dd375dac
parentae8bc27fdfb3f811e0435d4d12fa0d9c0dee31e9 (diff)
tests: rtpred: fix out-of-bound writes
Don't write more data to the buffer than we allocated space for. Fixes #3312 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6479>
-rw-r--r--subprojects/gst-plugins-good/tests/check/elements/rtpred.c4
1 files 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);