diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 36a179722f..7b5ce983a8 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -395,6 +395,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) {