[FFmpeg-devel] [PATCH] lavf/mov.c: Set duration to zero if the duration is UINT_MAX

Sasi Inguva isasi at google.com
Wed Oct 26 22:42:04 EEST 2016


Attaching the file that it fixes.


On Wed, Oct 26, 2016 at 12:40 PM, Sasi Inguva <isasi at google.com> wrote:

> Fixes some MP4F files which have duration in mdhd set to UINT_MAX instead
> of zero.
>
> Signed-off-by: Sasi Inguva <isasi at google.com>
> ---
>  libavformat/mov.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 357d800..245e424 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -1221,6 +1221,11 @@ static int mov_read_mdhd(MOVContext *c, AVIOContext
> *pb, MOVAtom atom)
>      sc->time_scale = avio_rb32(pb);
>      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);
> --
> 2.8.0.rc3.226.g39d4020
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: novideo_eac3_5sec_328.mp4
Type: video/mp4
Size: 260399 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161026/d6b35e3f/attachment.mp4>


More information about the ffmpeg-devel mailing list