Browse Source

id3v2: fix skipping extended header in id3v2.4

In v2.4, the length includes the length field itself.
(cherry picked from commit ddb4431208)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
tags/n0.10.3
Anton Khirnov 14 years ago
parent
commit
989431c02f
1 changed files with 11 additions and 2 deletions
  1. +11
    -2
      libavformat/id3v2.c

+ 11
- 2
libavformat/id3v2.c View File

@@ -448,8 +448,17 @@ static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t

unsync = flags & 0x80;

if (isv34 && flags & 0x40) /* Extended header present, just skip over it */
avio_skip(s->pb, get_size(s->pb, 4));
if (isv34 && flags & 0x40) { /* Extended header present, just skip over it */
int extlen = get_size(s->pb, 4);
if (version == 4)
extlen -= 4; // in v2.4 the length includes the length field we just read

if (extlen < 0) {
reason = "invalid extended header length";
goto error;
}
avio_skip(s->pb, extlen);
}

while (len >= taghdrlen) {
unsigned int tflags = 0;


Loading…
Cancel
Save