tests: fix out-of-bounds memory access in bytereader unit test

Caught by -fsanitize=address / libasan.

https://bugzilla.gnome.org/show_bug.cgi?id=739431
This commit is contained in:
Tim-Philipp Müller 2014-10-30 23:14:59 +00:00
parent e0d4eccc1e
commit 34abd91e90

View file

@ -722,7 +722,8 @@ GST_START_TEST (test_sub_reader)
fail_unless_equals_int (gst_byte_reader_get_remaining (&sub), 13);
fail_unless (gst_byte_reader_peek_data (&reader, 13, &data));
fail_unless (gst_byte_reader_peek_data (&sub, 13, &sub_data));
fail_unless (memcmp (data, sub_data, 16) == 0);
fail_unless (memcmp (data, sub_data, 13) == 0);
fail_unless (memcmp (memdata + 3, sub_data, 13) == 0);
fail_unless_equals_int (gst_byte_reader_get_remaining (&reader), 13);
fail_unless (gst_byte_reader_peek_sub_reader (&reader, &sub, 3));