From fc203a4bd7eb1cecc0e17bcb7ec67e0672806867 Mon Sep 17 00:00:00 2001 From: Ryan Hendrickson Date: Mon, 19 Oct 2015 15:36:37 +0300 Subject: [PATCH] qtmux: Don't unconditionally use strnlen() It's not available on older OSX and we can as well use memchr() here. https://bugzilla.gnome.org/show_bug.cgi?id=756154 --- gst/isomp4/gstqtmux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gst/isomp4/gstqtmux.c b/gst/isomp4/gstqtmux.c index 7f20f44f61..7f72443e05 100644 --- a/gst/isomp4/gstqtmux.c +++ b/gst/isomp4/gstqtmux.c @@ -694,6 +694,7 @@ gst_qt_mux_prepare_tx3g_buffer (GstQTPad * qtpad, GstBuffer * buf, GstMapInfo frommap; GstMapInfo tomap; gsize size; + const guint8 *dataend; GST_LOG_OBJECT (qtmux, "Preparing tx3g buffer %" GST_PTR_FORMAT, buf); @@ -702,7 +703,8 @@ gst_qt_mux_prepare_tx3g_buffer (GstQTPad * qtpad, GstBuffer * buf, gst_buffer_map (buf, &frommap, GST_MAP_READ); - size = (gint16) strnlen ((const char *) frommap.data, frommap.size); + dataend = memchr (frommap.data, 0, frommap.size); + size = dataend ? dataend - frommap.data : frommap.size; newbuf = gst_buffer_new_and_alloc (size + 2); gst_buffer_map (newbuf, &tomap, GST_MAP_WRITE);