diff --git a/libavformat/apetag.c b/libavformat/apetag.c index e861aac0f8..c53de41f31 100644 --- a/libavformat/apetag.c +++ b/libavformat/apetag.c @@ -120,7 +120,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; }