From patchwork Wed Oct 26 19:40:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasi Inguva X-Patchwork-Id: 1179 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.133 with SMTP id o127csp216192vsd; Wed, 26 Oct 2016 12:40:58 -0700 (PDT) X-Received: by 10.28.30.3 with SMTP id e3mr10398556wme.40.1477510858919; Wed, 26 Oct 2016 12:40:58 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id br5si4389325wjb.189.2016.10.26.12.40.58; Wed, 26 Oct 2016 12:40:58 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4FE9F689DDD; Wed, 26 Oct 2016 22:40:53 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf0-f182.google.com (mail-pf0-f182.google.com [209.85.192.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7BDF66898AF for ; Wed, 26 Oct 2016 22:40:50 +0300 (EEST) Received: by mail-pf0-f182.google.com with SMTP id s8so2080728pfj.2 for ; Wed, 26 Oct 2016 12:40:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Nf5Meh/43jbvvh3+26rmIST3l8oP+vCEw70AyzRhdiU=; b=Kyw6RunKTP84yQ5U2ggnHHKeK0snVh9Ae+NGzmeG7qKyR1ohuLPK/JhiWlUWLHg06w v28G9p89SuZp2GPO35TI/bBPD5odu/trZhurVRP+7bCnMXg10uxgwOhfBc+ZNeok6s41 99wooL5xRu+/q8azeRemE/clapXQ2QpN5KNxO6ed3EyHrW8b6WZF1VWqoEsv+7DZd30E 6jWlKJrok0DfGzOyVCOwULgQUaiSgt4WgY8kh2a6l6DCAlKhlPxX2PxJ5jPGO7Rk/q49 Vst+uSt8j6qyVOztSpGNnz/iCNnjCxZQpJDt/+RU3TjPfCGzV/hgW00iLp7pu7lzXzZ2 AZGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Nf5Meh/43jbvvh3+26rmIST3l8oP+vCEw70AyzRhdiU=; b=kpYRoU4TcQtzI4AHaaZluqLRkoo+3344Wg4u8Tp3EDGxsTgO6NRA6GF0o5BdokKsQa wFRwUKWI8ebfLRWrCx9q9iyKs9ZXA3T9BfigMrJ5EEri2CUwFU+JV/wTsvKw1H7HJpFc b5djbGv+FvKlclpg5jLx2ZPAEqX6+yelGQn7K46HYe5z2WawMxKsa7VCv7YeMXCttNGR Eoqymqjvc6VKv0OkykGo7fFdvpdiw2YttSEunEh+L4XVegKBAEsCZxEARTCy7MzYNB+I l3Yu2U2FZKKTkK+auLyIPM6wkCCP9qmHS9UlHpAsMRGsyGzwt5plvOtJDCWmlAn7vXFv NOJg== X-Gm-Message-State: ABUngvdFKjrMP9qNlGcWPUqtZCXxOMJnEL/2WUO69SCDtVLY+znSbAfWZK4hImATfpUmwRv5 X-Received: by 10.99.52.75 with SMTP id b72mr5991055pga.42.1477510850980; Wed, 26 Oct 2016 12:40:50 -0700 (PDT) Received: from isasi.mtv.corp.google.com ([172.27.82.89]) by smtp.gmail.com with ESMTPSA id p3sm6028091pfg.48.2016.10.26.12.40.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Oct 2016 12:40:50 -0700 (PDT) From: Sasi Inguva To: ffmpeg-devel@ffmpeg.org Date: Wed, 26 Oct 2016 12:40:13 -0700 Message-Id: <1477510813-17137-1-git-send-email-isasi@google.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 Subject: [FFmpeg-devel] [PATCH] lavf/mov.c: Set duration to zero if the duration is UINT_MAX X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Sasi Inguva MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes some MP4F files which have duration in mdhd set to UINT_MAX instead of zero. Signed-off-by: Sasi Inguva --- 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);