mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-07 07:55:41 +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/6479>
This commit is contained in:
parent
ae8bc27fdf
commit
37bacb49a9
1 changed files with 2 additions and 2 deletions
|
@ -398,7 +398,7 @@ GST_START_TEST (rtpreddec_invalid)
|
||||||
bufinp =
|
bufinp =
|
||||||
_new_rtp_buffer (FALSE, 0, PT_RED, 1, TIMESTAMP_NTH (1), 0xabe2b0b, 1);
|
_new_rtp_buffer (FALSE, 0, PT_RED, 1, TIMESTAMP_NTH (1), 0xabe2b0b, 1);
|
||||||
fail_unless (gst_rtp_buffer_map (bufinp, GST_MAP_WRITE, &rtp));
|
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);
|
gst_rtp_buffer_unmap (&rtp);
|
||||||
_push_and_check_didnt_go_through (h, bufinp);
|
_push_and_check_didnt_go_through (h, bufinp);
|
||||||
|
|
||||||
|
@ -406,7 +406,7 @@ GST_START_TEST (rtpreddec_invalid)
|
||||||
bufinp =
|
bufinp =
|
||||||
_new_rtp_buffer (FALSE, 0, PT_RED, 2, TIMESTAMP_NTH (2), 0xabe2b0b, 4);
|
_new_rtp_buffer (FALSE, 0, PT_RED, 2, TIMESTAMP_NTH (2), 0xabe2b0b, 4);
|
||||||
fail_unless (gst_rtp_buffer_map (bufinp, GST_MAP_WRITE, &rtp));
|
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);
|
gst_rtp_buffer_unmap (&rtp);
|
||||||
_push_and_check_didnt_go_through (h, bufinp);
|
_push_and_check_didnt_go_through (h, bufinp);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue