Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhao Zhili <quinkblack@foxmail.com>2022-04-26 11:05:16 +0300
committerZhao Zhili <zhilizhao@tencent.com>2022-05-08 18:46:52 +0300
commit6c1b685e20edc6ead607b935d1d79740b9857e25 (patch)
tree8adaa0fea35b30d4f8e6ef27394ff1d2f650cef6 /libavformat/mov.c
parent4f698be741bd615aa2cde908cbef5e857a754f50 (diff)
avformat/mov: fix use invalid box size/type due to eof
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index dc55ea7255..87760cab95 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -7689,10 +7689,12 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if (atom.size < 0)
atom.size = INT64_MAX;
- while (total_size <= atom.size - 8 && !avio_feof(pb)) {
+ while (total_size <= atom.size - 8) {
int (*parse)(MOVContext*, AVIOContext*, MOVAtom) = NULL;
a.size = avio_rb32(pb);
a.type = avio_rl32(pb);
+ if (avio_feof(pb))
+ break;
if (((a.type == MKTAG('f','r','e','e') && c->moov_retry) ||
a.type == MKTAG('h','o','o','v')) &&
a.size >= 8 &&