summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2021-05-23 15:14:11 +0100
committerTim-Philipp Müller <tim@centricular.com>2021-06-01 02:01:21 +0100
commit010b2d96fb0bce11d224258a41de4863d13a34c2 (patch)
tree88b8b62cc4e48485540ada6dc0282bdc401d8812
parent9e98ed4c1df66c0bb8cebcc807194c8e18084b03 (diff)
downloadgstreamer-plugins-good-010b2d96fb0bce11d224258a41de4863d13a34c2.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/1000>
-rw-r--r--gst/wavparse/gstwavparse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c
index 360715f28..7d4d753f4 100644
--- a/gst/wavparse/gstwavparse.c
+++ b/gst/wavparse/gstwavparse.c
@@ -833,7 +833,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);
@@ -862,7 +862,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);