avformat/rmdec: Fix EOF check in the stream loop in ivr_read_header()
authorMichael Niedermayer <[email protected]>
Thu, 16 Aug 2018 13:36:29 +0000 (15:36 +0200)
committerMichael Niedermayer <[email protected]>
Mon, 22 Oct 2018 23:44:40 +0000 (01:44 +0200)
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]>
(cherry picked from commit c2eec1762d372663c35aaf3d6ee419bafb185057)
Signed-off-by: Michael Niedermayer <[email protected]>
libavformat/rmdec.c

index 48420cfd67d53b6696c437975fb54b165af64860..e3c8c56e4ccdf18ac10540cac8fdc291da788b57 100644 (file)
@@ -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);
                 }