aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-02 00:52:23 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-02 00:52:23 +0200
commit976d173606769e09442d1ab2ca1436ffd96a35be (patch)
tree1b3a8716960300c939d8cd71dc29f361ff91e920
parentf9bdc93723cc38f91de68d364854e7fa6b5857eb (diff)
parent989431c02ffcfdeb210cf42765e820130eb4b255 (diff)
downloadffmpeg-976d173606769e09442d1ab2ca1436ffd96a35be.tar.gz
Merge remote-tracking branch 'qatar/release/0.8' into release/0.10
* qatar/release/0.8: id3v2: fix skipping extended header in id3v2.4 Conflicts: libavformat/id3v2.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/id3v2.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index 250281c357..e4c4fc90b2 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -464,21 +464,21 @@ static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t
unsync = flags & 0x80;
- /* Extended header present, just skip over it */
- if (isv34 && flags & 0x40) {
- int size = get_size(s->pb, 4);
- if (size < 6) {
- reason = "extended header too short.";
+ 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;
}
- len -= size;
+ avio_skip(s->pb, extlen);
+ len -= extlen + 4;
if (len < 0) {
reason = "extended header too long.";
goto error;
}
- /* already seeked past size, skip the reset */
- size -= 4;
- avio_skip(s->pb, size);
}
while (len >= taghdrlen) {