summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorSasi Inguva <isasi@google.com>2016-10-26 12:40:13 -0700
committerJames Almer <jamrial@gmail.com>2022-11-29 08:39:32 -0300
commit9d8d7bdffb0e0e229b7d896c2df04a0237e9a243 (patch)
treedcd4e57b754eed49687df04eaf1e28b6a6337dee /libavformat/mov.c
parentd34c1b389ee6395ba81eec4d50316f189681da5d (diff)
avformat/mov: Set duration to zero if the duration is UINT_MAX
Fixes some MP4F files which have duration in mdhd set to UINT_MAX instead of zero. Signed-off-by: Sasi Inguva <isasi@google.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 1f436e21d6..29bd3103e3 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1489,6 +1489,11 @@ static int mov_read_mdhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
}
st->duration = (version == 1) ? avio_rb64(pb) : avio_rb32(pb); /* duration */
+ if ((version == 1 && st->duration == UINT64_MAX) ||
+ (version != 1 && st->duration == UINT32_MAX)) {
+ st->duration = 0;
+ }
+
lang = avio_rb16(pb); /* language */
if (ff_mov_lang_to_iso639(lang, language))
av_dict_set(&st->metadata, "language", language, 0);