From patchwork Thu Mar 8 19:13:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 7874 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.181.170 with SMTP id m39csp117323jaj; Thu, 8 Mar 2018 11:13:59 -0800 (PST) X-Google-Smtp-Source: AG47ELuX/R9ibcdA+JDG82NFEDmnzbabA6bivVnhu0tp6H7Ng9Q+w8gxItXnkgqg9CvH06AGPQZO X-Received: by 10.28.51.67 with SMTP id z64mr17260852wmz.59.1520536439508; Thu, 08 Mar 2018 11:13:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520536439; cv=none; d=google.com; s=arc-20160816; b=BNfpYmkvwWKSzFlM0BG6ykxFN0Cl6VG8QaOSMl50YKrQFH8e5Z1O6uyX3bxp8HCy+T dnvM5OIbN2mm8Ev8Osi+v+lWTvG3vrGvPQ24GAu5rrcsE8bV8MltArJ190qD+4OfSftP WLqnf/irPuhawxrVX9L+rOIjlFl0vZqaadjksnQzhD4L1HrvO5MTf/koFY+PlA/dpIMU xgS2D1nCRttJgq3rWtsA9kR1F93w7Uwm/ZjK7oRi1TK6kzT3hCw37pxRAZUtysfKRt40 mr9+vUPtqmxBkUeDELvEILScsSZXhL4MZyD53UM+VREaeugJcl7E406TY7ltzTyDRtbr TOtA== 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:delivered-to :arc-authentication-results; bh=a1YIlan72At6GoGf1kPhqdt+bVNe4wLtuiXlKSA+xpA=; b=rIr0ywixsNLliWPUn6OnKIYHYRFW/KCZmcqiMaSxmXfN63ZWPw6qeWT6GZX4SbSWk8 wH8/5EprVMtiDSZ47dg/kHaay9zSo0AIqkA4pje4wBMBHwe0YoO4wIh8/PUj+4WlDb3c 0N7xXxRT12gh3uQwtB1IrUvB/vqb1k49JizWfGsvaD1DDuMF3TcV/MuoXe7w6tlbyoXy LGTmC3UdjAISlasVbd3VknaNNti8PYJ9PnI/jnA+MYnJErODCYtk4BvPT2RXwGEdompj JswwG2dzbhFYezJiMwM0A+DEoWCCrOfq+Xwbn+DQGr6ZD3ya6CA4w5rj3o7JjIEewkoO XxfA== ARC-Authentication-Results: i=1; mx.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id x80si4316195wma.74.2018.03.08.11.13.53; Thu, 08 Mar 2018 11:13:59 -0800 (PST) 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; 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 0211068A645; Thu, 8 Mar 2018 21:13:43 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe01-1.mx.upcmail.net (vie01a-dmta-pe01-1.mx.upcmail.net [62.179.121.154]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4FDCB68A638 for ; Thu, 8 Mar 2018 21:13:36 +0200 (EET) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe01.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1eu0z2-0008Cb-FM for ffmpeg-devel@ffmpeg.org; Thu, 08 Mar 2018 20:13:44 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id KXDb1x0030S5wYM01XDcVL; Thu, 08 Mar 2018 20:13:36 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 8 Mar 2018 20:13:26 +0100 Message-Id: <20180308191327.22228-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.16.2 Subject: [FFmpeg-devel] [PATCH 1/2] avformat/oggparsetheora: Do not adjust AV_NOPTS_VALUE 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" Fixes: Chromium bug 795653 Fixes: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long' Reported-by: Matt Wolenetz Signed-off-by: Michael Niedermayer --- libavformat/oggparsetheora.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavformat/oggparsetheora.c b/libavformat/oggparsetheora.c index b14f9f0669..b0c0edc7a5 100644 --- a/libavformat/oggparsetheora.c +++ b/libavformat/oggparsetheora.c @@ -181,6 +181,7 @@ static int theora_packet(AVFormatContext *s, int idx) if ((!os->lastpts || os->lastpts == AV_NOPTS_VALUE) && !(os->flags & OGG_FLAG_EOS)) { int seg; + int64_t pts; duration = 1; for (seg = os->segp; seg < os->nsegs; seg++) { @@ -188,7 +189,10 @@ static int theora_packet(AVFormatContext *s, int idx) duration ++; } - os->lastpts = os->lastdts = theora_gptopts(s, idx, os->granule, NULL) - duration; + pts = theora_gptopts(s, idx, os->granule, NULL); + if (pts != AV_NOPTS_VALUE) + pts -= duration; + os->lastpts = os->lastdts = pts; if(s->streams[idx]->start_time == AV_NOPTS_VALUE) { s->streams[idx]->start_time = os->lastpts; if (s->streams[idx]->duration > 0)