From b01cf1561c14dace6e6988668ceecda82a1aa7b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 17 Jul 2012 10:01:54 +0200 Subject: [PATCH] flacparse: Fix parsing of ISRC from the cuesheets --- gst/audioparsers/gstflacparse.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gst/audioparsers/gstflacparse.c b/gst/audioparsers/gstflacparse.c index 6a41d96d0d..3bb390f7d7 100644 --- a/gst/audioparsers/gstflacparse.c +++ b/gst/audioparsers/gstflacparse.c @@ -1017,9 +1017,15 @@ gst_flac_parse_handle_cuesheet (GstFlacParse * flacparse, GstBuffer * buffer) goto error; if (!gst_byte_reader_get_uint8 (&reader, &track_num)) goto error; - if (!gst_byte_reader_skip (&reader, 12)) + + if (gst_byte_reader_get_remaining (&reader) < 12) goto error; memcpy (isrc, map.data + gst_byte_reader_get_pos (&reader), 12); + /* \0-terminate the string */ + isrc[12] = '\0'; + if (!gst_byte_reader_skip (&reader, 12)) + goto error; + /* skip 14 bytes from CUESHEET_TRACK */ if (!gst_byte_reader_skip (&reader, 14)) goto error;