summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2018-08-16 15:36:29 +0200
committerMichael Niedermayer <[email protected]>2018-08-17 21:53:13 +0200
commitc2eec1762d372663c35aaf3d6ee419bafb185057 (patch)
treee0ad70453e16dad7b174454b05bf8878755e81c1
parent1e71cb2c8edcf3dad657c15a6fb8572862f2afb9 (diff)
avformat/rmdec: Fix EOF check in the stream loop in ivr_read_header()
Fixes: long running loop Fixes: ivr-timeout-42468cb797f52f025fb329394702f5d4d64322d6 Found-by: Paul Ch <[email protected]> Reviewed-by: Paul B Mahol <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavformat/rmdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 0216003e88..f26c5b4d90 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -1269,6 +1269,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);
}