mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
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/6474>
This commit is contained in:
parent
37e3a38ba9
commit
ef5b8dc96a
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue