mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 20:42:30 +00:00
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
This commit is contained in:
parent
0cefb6722b
commit
fc203a4bd7
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue