tests: pad: fix invalid memory access in debug log message

The string we put in the buffer is not NUL-terminated, so
don't try to print that via %s in a debug log message.
This commit is contained in:
Tim-Philipp Müller 2015-04-18 11:11:26 +01:00
parent 41946aa3f6
commit 0759058896

View file

@ -791,7 +791,9 @@ buffer_compare (GstBuffer * buf, const gchar * str, gsize size)
fail_unless (gst_buffer_map (buf, &info, GST_MAP_READ));
res = memcmp (info.data, str, size) == 0;
GST_DEBUG ("%s <-> %s: %d", (gchar *) info.data, str, res);
GST_MEMDUMP ("buffer data", info.data, size);
GST_MEMDUMP ("compare data", (guint8 *) str, size);
GST_DEBUG ("buffers match: %s", res ? "yes" : "no");
gst_buffer_unmap (buf, &info);
return res;