diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index b531a39adc..6dce9b8dcd 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -496,6 +496,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) {