diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index a2dea464e3..0dd14e1c39 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -469,6 +469,8 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, num_val = 0; ioc = s->pb; + if (avio_feof(ioc)) + return AVERROR_EOF; amf_type = avio_r8(ioc); switch (amf_type) {