diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 36674195a1..8eb382744f 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -2628,6 +2628,8 @@ static int matroska_read_header(AVFormatContext *s) if (!matroska->time_scale) matroska->time_scale = 1000000; + if (isnan(matroska->duration)) + matroska->duration = 0; if (matroska->duration) matroska->ctx->duration = matroska->duration * matroska->time_scale * 1000 / AV_TIME_BASE;