From: Tim-Philipp Müller Date: Fri, 7 Aug 2009 15:42:39 +0000 (+0100) Subject: id3demux: sizes in ID3 v2.3 are unlikely to be sync-safe integers X-Git-Tag: 1.19.3~509^2~10012 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=04172830773414dafb698fd842b65b935277df92;p=platform%2Fupstream%2Fgstreamer.git id3demux: sizes in ID3 v2.3 are unlikely to be sync-safe integers In ID3 v2.3 compressed frames will have a 4-byte data length indicator after the frame header to indicate the size of the decompressed data. This integer is unlikely to be a sync-safe integer for v2.3 tags, only in v2.4 it's sync-safe. --- diff --git a/gst/id3demux/id3v2frames.c b/gst/id3demux/id3v2frames.c index a0331ef..80a123a 100644 --- a/gst/id3demux/id3v2frames.c +++ b/gst/id3demux/id3v2frames.c @@ -108,7 +108,11 @@ id3demux_id3v2_parse_frame (ID3TagsWorking * work) ID3V2_FRAME_FORMAT_DATA_LENGTH_INDICATOR)) { if (work->hdr.frame_data_size <= 4) return FALSE; - work->parse_size = read_synch_uint (frame_data, 4); + if (ID3V2_VER_MAJOR (work->hdr.version) == 3) { + work->parse_size = GST_READ_UINT32_BE (frame_data); + } else { + work->parse_size = read_synch_uint (frame_data, 4); + } frame_data += 4; frame_data_size -= 4; if (work->parse_size < frame_data_size) {