[FFmpeg-devel] [PATCH 1/3] id3v2: skip data length indicator

Anton Khirnov anton
Mon Dec 6 09:33:07 CET 2010


---
 libavformat/id3v2.c |    5 +++++
 libavformat/id3v2.h |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index c0fab69..4115f8f 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -224,6 +224,11 @@ void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t flags)
 
         next = url_ftell(s->pb) + tlen;
 
+        if (tflags & ID3v2_FLAG_DATALEN) {
+            get_be32(s->pb);
+            tlen -= 4;
+        }
+
         if (tag[0] == 'T') {
             if (unsync || tunsync) {
                 int i, j;
diff --git a/libavformat/id3v2.h b/libavformat/id3v2.h
index 48373bb..4c3041f 100644
--- a/libavformat/id3v2.h
+++ b/libavformat/id3v2.h
@@ -33,6 +33,11 @@
  */
 #define ID3v2_DEFAULT_MAGIC "ID3"
 
+#define ID3v2_FLAG_DATALEN     0x0001
+#define ID3v2_FLAG_UNSYNCH     0x0002
+#define ID3v2_FLAG_ENCRYPTION  0x0004
+#define ID3v2_FLAG_COMPRESSION 0x0008
+
 /**
  * Detect ID3v2 Header.
  * @param buf   must be ID3v2_HEADER_SIZE byte long
-- 
1.7.2.3




More information about the ffmpeg-devel mailing list