diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-03-23 02:42:56 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-03-23 02:42:56 +0100 |
commit | 4fa0e24736bff7d7fbdfb36ed578a1db166817d4 (patch) | |
tree | 3e74e32f82b02ff498320e07424d330473f44fd3 /libavformat/id3v2.c | |
parent | 4952afff75bc60df9c842bc248f1da8fe57e04a6 (diff) | |
parent | ee26abf2a4884bb56959bac8215758195776c553 (diff) | |
download | ffmpeg-4fa0e24736bff7d7fbdfb36ed578a1db166817d4.tar.gz |
Merge remote-tracking branch 'newdev/master'
* newdev/master: (33 commits)
Fix an infinite loop when RoQ encoded generated a frame with a size greater than the maximum valid size.
Add kbdwin.o to AC3 decoder
Detect byte-swapped AC-3 and support decoding it directly.
cosmetics: indentation
Always copy input data for AC3 decoder.
ac3enc: make sym_quant() branch-free
cosmetics: indentation
Add a CPU flag for the Atom processor.
id3v2: skip broken tags with invalid size
id3v2: don't explicitly skip padding
Make sure kbhit() is in conio.h
fate: update wmv8-drm reference
vc1: make P-frame deblock filter bit-exact.
configure: Add the -D parameter to the dlltool command
amr: Set the AVFMT_GENERIC_INDEX flag
amr: Set the pkt->pos field properly to the start of the packet
amr: Set the codec->bit_rate field based on the last packet
rtsp: Specify unicast for TCP interleaved streams, too
Set the correct target for mingw64 dlltool
applehttp: Change the variable for stream position in seconds into int64_t
...
Conflicts:
ffmpeg.c
ffplay.c
libavcodec/ac3dec.c
libavformat/avio.h
libavformat/id3v2.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/id3v2.c')
-rw-r--r-- | libavformat/id3v2.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c index 027b8d717c..95353276b5 100644 --- a/libavformat/id3v2.c +++ b/libavformat/id3v2.c @@ -187,9 +187,9 @@ static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t int isv34, unsync; unsigned tlen; char tag[5]; - int64_t next; + int64_t next, end = avio_tell(s->pb) + len; int taghdrlen; - const char *reason; + const char *reason = NULL; AVIOContext pb; unsigned char *buffer = NULL; int buffer_size = 0; @@ -282,20 +282,15 @@ static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t avio_seek(s->pb, next, SEEK_SET); } - if (len > 0) { - /* Skip padding */ - avio_skip(s->pb, len); - } if (version == 4 && flags & 0x10) /* Footer preset, always 10 bytes, skip over it */ - avio_skip(s->pb, 10); - - av_free(buffer); - return; + end += 10; error: - av_log(s, AV_LOG_INFO, "ID3v2.%d tag skipped, cannot handle %s\n", version, reason); - avio_seek(s->pb, len, SEEK_CUR); + if (reason) + av_log(s, AV_LOG_INFO, "ID3v2.%d tag skipped, cannot handle %s\n", version, reason); + avio_seek(s->pb, end, SEEK_SET); av_free(buffer); + return; } void ff_id3v2_read(AVFormatContext *s, const char *magic) |