diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index f0c8e1fe66..1128ad2b7b 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -781,6 +781,9 @@ static int amf_skip_tag(AVIOContext *pb, AMFDataType type, int depth) if (depth > MAX_DEPTH) return AVERROR_PATCHWELCOME; + if (avio_feof(pb)) + return AVERROR_EOF; + switch (type) { case AMF_DATA_TYPE_NUMBER: avio_skip(pb, 8);