From patchwork Fri Sep 29 22:04:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 5344 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.61.197 with SMTP id n188csp1276029jan; Fri, 29 Sep 2017 15:12:32 -0700 (PDT) X-Received: by 10.28.131.131 with SMTP id f125mr4555724wmd.137.1506723152573; Fri, 29 Sep 2017 15:12:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506723152; cv=none; d=google.com; s=arc-20160816; b=KSp7aWQ00tlo2v5pyANBcL4PLl8ZctwqbN4D/4tubccgpXIQHUc4mvqGfKgmYZzx7m fWluKTMy4E8erOBG0zbW3yrBJ6zqC0DzPnaFO/IRG8nHw1KR+TOWnLyZ65WbK1w5OWvO 11aHvV74XW9lv3KWj25+RnvgJUoJEXxYFBJSt+0oVhiP51u8TQ1jdnLpxAwE+6IFIifI ZLY5+TpNaq8ITFmnHOhnxYdvwI0wZ32QH0lrWNnVGj5/Duzz3CmbCy/zuEorWmSULwJU q26G1GVp/IskBaI9INOoE/iaRuEvzdIdagR18jaLgUOGp4xkc8kF4dK9cgIoj6ZG4SDH 6mDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=jAGYb9Pv0thgaZbk53QKUIbPNmQORMXVABibC2ajl6s=; b=0W6OvW0jldf4CHVXB7lonILhJoFI5uO6T3tme14/DZYyIYY2v6+S5lREDKWuUo1iIl hbU/vNO+1CtauV02hYlJx0mOFWrJyZrYx1yZUH4GdUKzbXXTOf+1JIRrDqNJaG4XbZI3 j7+yeA9lT5vvbboGVEZ/xUjqwIi/DvuD9skl3aBtH8eFN+LBO8ntnOK2/Ttsi4a/gh8f Oc+zmC138mkbDb4kHc6X/3xtOFPm7+7dCMBIUydt/ZCugtXuAui67gQgOSEDGFQ6QbLE tGE+pX5g+n+9KFHh1eok+eafi30p7q52qidZx2Wu2it89GCcNJ9BZ4mKESBY9sdPIhFc AC/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=WnFN4Ddf; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id k52si4359785wrf.83.2017.09.29.15.12.31; Fri, 29 Sep 2017 15:12:32 -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=@gmail.com header.s=20161025 header.b=WnFN4Ddf; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9785C6899A4; Sat, 30 Sep 2017 01:12:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EA4366897FF for ; Sat, 30 Sep 2017 01:12:11 +0300 (EEST) Received: by mail-lf0-f44.google.com with SMTP id l196so956731lfl.1 for ; Fri, 29 Sep 2017 15:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=t4bmTKxbP8EYM0XEhAZWKitQ51CjddDUSlQryB/oIFk=; b=WnFN4DdfMixO+/iJQjxwp53XALvOqxL5mekMuGOm9WdQA4KX0sXdeTxG2IADuj83N1 H5GaGQZ2prA2JToDMtmhsyHv/p6JGkln9XmJXsGIZmw2kNS5rPt3RIk7thK0QdWCuIhL gct6MLTXbv06f5vAfHZooF8105GVHYwV6CiI9DyhmVXBIVyA4szIso+lRTB91VYLfEIq vgyueLtPdQZNJXI/jAzw06BMhZHkkxspy8l9hgWLyHmm2/UgLp9KNaoYKtBhE7AlHUQN vlnJdl94nggGQaOCjn3sEgGKHut8x09MGqd0H0EQ2q0pwv5ylq2oZlje1+7kdSJyj6S3 T+Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=t4bmTKxbP8EYM0XEhAZWKitQ51CjddDUSlQryB/oIFk=; b=jeEbdlsdu1R4AVzuigkUUROw8VYIedtvQEj6iil9h06wjDfloDuc0emoP8j3gksUVB vvWgZC4Q20eICY2q8EX/E5mgAh757/Hamjbt+iWREeR7pBSpGH+gP2aZ8a9Sj50nzUND e7xuyvOatwY2CuCRE/yutoSqsI34P6Xu2ECjxkGuEPmOD1BOryaMbKc4gYjeBSuHyJ08 FCAZ7e7+2kL2iUlbiojmQtr5fzymqKYn8hkiRZJwlqxz9Gwjilfg5JMS4oe3yirZl8F7 z6KNNTPozz7wUxrUIbsMgJPuHfz0Xj2jl0G043Is/hnb/rWlVKPWkmq4cLWm4vqq8rcq Hhog== X-Gm-Message-State: AHPjjUhrHUUS4nS5nRHRyxcBZSDeG5vL9GreZt1JpmXH1NwVZHAeMhbt xlWVV+Vmqnl0q6IgOUECLvwaTAFa X-Google-Smtp-Source: AOwi7QBbv+wWH6xcTxJXeUm2m4WiRTzVkAiumi1BJheI1nhiISUGKTEZPXmc2iZkGIU85CxSNf6hAA== X-Received: by 10.46.77.154 with SMTP id c26mr4448601ljd.184.1506722642811; Fri, 29 Sep 2017 15:04:02 -0700 (PDT) Received: from localhost.localdomain (91-159-194-103.elisa-laajakaista.fi. [91.159.194.103]) by smtp.gmail.com with ESMTPSA id a139sm692086lfa.39.2017.09.29.15.04.01 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Sep 2017 15:04:02 -0700 (PDT) From: =?UTF-8?q?Jan=20Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Sat, 30 Sep 2017 01:04:00 +0300 Message-Id: <20170929220400.28352-1-jeebjp@gmail.com> X-Mailer: git-send-email 2.13.6 Subject: [FFmpeg-devel] [PATCH] movenc: take packet dts shifting into mention in check_pkt 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This FFmpeg-specific "fuzzer fix" was never perfect, but now it stopped encoding of actual content with a big enough DTS shift. This returns the function to its original state of results before negative CTS offsets were added. I remember dealing with this function before, but somehow had forgotten about it during VDD. The test cases not tripping this over also didn't help. --- libavformat/movenc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 9c3e6437d7..2838286141 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -4989,6 +4989,12 @@ static int check_pkt(AVFormatContext *s, AVPacket *pkt) } else ref = pkt->dts; // Skip tests for the first packet + if (trk->dts_shift != AV_NOPTS_VALUE) { + /* With negative CTS offsets we have set an offset to the DTS, + * reverse this for the check. */ + ref -= trk->dts_shift; + } + duration = pkt->dts - ref; if (pkt->dts < ref || duration >= INT_MAX) { av_log(s, AV_LOG_ERROR, "Application provided duration: %"PRId64" / timestamp: %"PRId64" is out of range for mov/mp4 format\n",