diff options
author | Ryan Hendrickson <ryan.hendrickson@alum.mit.edu> | 2015-10-19 15:36:37 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-10-20 10:14:41 +0300 |
commit | 58d1c45b007d930a1e78270f6d79d9fe14e41f93 (patch) | |
tree | 039b7233b8bc58999586bbf9db67c2424d0dd6fb /gst/isomp4 | |
parent | 232a97aeb882f8f374364245975982ebc2677720 (diff) | |
download | gstreamer-plugins-good-58d1c45b007d930a1e78270f6d79d9fe14e41f93.tar.gz |
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
Diffstat (limited to 'gst/isomp4')
-rw-r--r-- | gst/isomp4/gstqtmux.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gst/isomp4/gstqtmux.c b/gst/isomp4/gstqtmux.c index ccc6ecfd9..c62171b5a 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); |