diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2021-05-23 15:14:11 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2021-05-23 15:20:16 +0100 |
commit | 80966ed0a3532a8be77ba0e4f4792e2b30b86bb5 (patch) | |
tree | 172008be812bf9de08d4e2df4985a6326912746f | |
parent | 5353ff355f954b171847d0b4f191bca46e1844fe (diff) | |
download | gstreamer-80966ed0a3532a8be77ba0e4f4792e2b30b86bb5.tar.gz |
wavparse: use g_strndup() for copying text data
So we don't rely on NUL terminators inside the data.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/994>
-rw-r--r-- | gst/wavparse/gstwavparse.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c index 3279957f20..45b9db94d3 100644 --- a/gst/wavparse/gstwavparse.c +++ b/gst/wavparse/gstwavparse.c @@ -837,7 +837,7 @@ gst_wavparse_labl_chunk (GstWavParse * wav, const guint8 * data, guint32 size) /* parse data */ labl->cue_point_id = GST_READ_UINT32_LE (data); - labl->text = g_memdup (data + 4, size - 4); + labl->text = g_strndup ((const gchar *) data + 4, size - 4); wav->labls = g_list_append (wav->labls, labl); @@ -866,7 +866,7 @@ gst_wavparse_note_chunk (GstWavParse * wav, const guint8 * data, guint32 size) /* parse data */ note->cue_point_id = GST_READ_UINT32_LE (data); - note->text = g_memdup (data + 4, size - 4); + note->text = g_strndup ((const gchar *) data + 4, size - 4); wav->notes = g_list_append (wav->notes, note); |