summaryrefslogtreecommitdiff
path: root/libavformat/mpc8.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-07-30 07:28:35 +0200
committerAnton Khirnov <anton@khirnov.net>2012-07-31 20:53:54 +0200
commit782e64fbe1daa84c38594db037d0edfac7193c37 (patch)
treecedf605a86dbedc8f67569e1cceae1c1951cb83b /libavformat/mpc8.c
parent9c9c21eaa1f0adf1c5cd17f9b31a18b979bffe37 (diff)
wv,mpc8: don't return apetag data in packets.
Diffstat (limited to 'libavformat/mpc8.c')
-rw-r--r--libavformat/mpc8.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c
index 93848f4ebf..6b9f77e6ab 100644
--- a/libavformat/mpc8.c
+++ b/libavformat/mpc8.c
@@ -52,6 +52,8 @@ typedef struct {
int frame;
int64_t header_pos;
int64_t samples;
+
+ int64_t apetag_start;
} MPCContext;
static inline int64_t bs_get_v(uint8_t **bs)
@@ -243,7 +245,7 @@ static int mpc8_read_header(AVFormatContext *s)
if (pb->seekable) {
int64_t pos = avio_tell(s->pb);
- ff_ape_parse_tag(s);
+ c->apetag_start = ff_ape_parse_tag(s);
avio_seek(s->pb, pos, SEEK_SET);
}
@@ -258,6 +260,11 @@ static int mpc8_read_packet(AVFormatContext *s, AVPacket *pkt)
while(!s->pb->eof_reached){
pos = avio_tell(s->pb);
+
+ /* don't return bogus packets with the ape tag data */
+ if (c->apetag_start && pos >= c->apetag_start)
+ return AVERROR_EOF;
+
mpc8_get_chunk_header(s->pb, &tag, &size);
if (size < 0)
return -1;