From f6586a526fece048e96731b6da6aee42d10679d7 Mon Sep 17 00:00:00 2001 From: "jiyong.min" Date: Wed, 26 Jun 2019 16:00:53 +0900 Subject: [PATCH] Apply patch from MCD [Problem] Taking long time to get attributes of avi file [Cause] trying to get the index of the file even though eof reached [Solution] Add to returned if eof reached in libav Change-Id: If0443c727a8ec1deea177e15d5b29af72e2a89a4 --- libavformat/avidec.c | 3 +++ 1 file changed, 3 insertions(+) mode change 100755 => 100644 libavformat/avidec.c diff --git a/libavformat/avidec.c b/libavformat/avidec.c old mode 100755 new mode 100644 index fbece0e..e5f0d0e --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -1317,6 +1317,9 @@ static int avi_read_idx1(AVFormatContext *s, int size) av_log(s, AV_LOG_TRACE, "%d: tag=0x%x flags=0x%x pos=0x%x len=%d/", i, tag, flags, pos, len); + if (pb->eof_reached) + return AVERROR_INVALIDDATA; + index = ((tag & 0xff) - '0') * 10; index += (tag >> 8 & 0xff) - '0'; if (index >= s->nb_streams) -- 2.7.4