diff --git a/libavformat/apetag.c b/libavformat/apetag.c index bd0a19e4d6..0989fcb094 100644 --- a/libavformat/apetag.c +++ b/libavformat/apetag.c @@ -121,7 +121,8 @@ int64_t ff_ape_parse_tag(AVFormatContext *s) avio_seek(pb, file_size - APE_TAG_FOOTER_BYTES, SEEK_SET); - avio_read(pb, buf, 8); /* APETAGEX */ + if(avio_read(pb, buf, 8) != 8) /* APETAGEX */ + return 0; if (strncmp(buf, APE_TAG_PREAMBLE, 8)) { return 0; }