summaryrefslogtreecommitdiff
path: root/libavformat/wv.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-07-31 22:41:00 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-07-31 22:41:00 +0200
commitd1dad7c824c14939a0e18fa262f3e51957de6e3e (patch)
tree615f6ba80611f53e520d2ae479d9d4409077a78d /libavformat/wv.c
parentd2ca5dd0f33b0fdbb5d2a7429c8f71ff1dffffb7 (diff)
parentf2ed006c90ccb65cd143d8b0fcfc28ffb98c4289 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: mpc8: return more meaningful error codes. mpc: return more meaningful error codes. wv,mpc8: don't return apetag data in packets. rtmp: do not warn about receiving metadata packets x86: h264dsp: Adjust YASM #ifdefs x86: yadif: Mark mmxext optimizations as such h264: convert loop filter strength dsp function to yasm. Improve descriptiveness of a number of codec and container long names Conflicts: libavcodec/flvdec.c libavcodec/libopenjpegdec.c libavformat/apetag.c libavformat/mp3dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/wv.c')
-rw-r--r--libavformat/wv.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/wv.c b/libavformat/wv.c
index cc01ff16f4..95d5044dbd 100644
--- a/libavformat/wv.c
+++ b/libavformat/wv.c
@@ -64,6 +64,8 @@ typedef struct {
int block_parsed;
uint8_t extra[WV_EXTRA_SIZE];
int64_t pos;
+
+ int64_t apetag_start;
} WVContext;
static int wv_probe(AVProbeData *p)
@@ -88,6 +90,11 @@ static int wv_read_block_header(AVFormatContext *ctx, AVIOContext *pb,
uint32_t chmask;
wc->pos = avio_tell(pb);
+
+ /* don't return bogus packets with the ape tag data */
+ if (wc->apetag_start && wc->pos >= wc->apetag_start)
+ return AVERROR_EOF;
+
if (!append) {
tag = avio_rl32(pb);
if (tag != MKTAG('w', 'v', 'p', 'k'))
@@ -252,7 +259,7 @@ static int wv_read_header(AVFormatContext *s)
if (s->pb->seekable) {
int64_t cur = avio_tell(s->pb);
- ff_ape_parse_tag(s);
+ wc->apetag_start = ff_ape_parse_tag(s);
if (!av_dict_get(s->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX))
ff_id3v1_read(s);
avio_seek(s->pb, cur, SEEK_SET);