diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 48420cfd67..e3c8c56e4c 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -1278,6 +1278,8 @@ static int ivr_read_header(AVFormatContext *s) if (avio_rb32(pb) == MKBETAG('M', 'L', 'T', 'I')) { ret = rm_read_multi(s, pb, st, NULL); } else { + if (avio_feof(pb)) + return AVERROR_INVALIDDATA; avio_seek(pb, -4, SEEK_CUR); ret = ff_rm_read_mdpr_codecdata(s, pb, st, st->priv_data, len, NULL); }