Apply patch from MCD 82/208582/2
authorjiyong.min <jiyong.min@samsung.com>
Wed, 26 Jun 2019 07:00:53 +0000 (16:00 +0900)
committerjiyong.min <jiyong.min@samsung.com>
Wed, 26 Jun 2019 07:14:31 +0000 (16:14 +0900)
[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 [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index fbece0e..e5f0d0e
@@ -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)