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>
This commit is contained in:
Sasi Inguva 2016-10-26 12:40:13 -07:00 committed by James Almer
parent d34c1b389e
commit 9d8d7bdffb

View File

@ -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);