From patchwork Fri Sep 17 19:56:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 30314 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp2511705iov; Fri, 17 Sep 2021 12:57:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmUwYTeaiaGnvokhq4j/yzRwKRGetqjdOqnzOYxRijfPorjKMWffBhr8h1aA79gsgAL6J3 X-Received: by 2002:a05:6402:13d0:: with SMTP id a16mr14209420edx.155.1631908649810; Fri, 17 Sep 2021 12:57:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631908649; cv=none; d=google.com; s=arc-20160816; b=cOp8aKxbGk+d+rtZd/YH3nIQLmUdJuptL9IKq7pKurwhaKynFezitQ7Jg7slp7TcrA AOs/886jBEEVwfjtfof4POXDJqcQI+q8Gb3+OoOTfhrLJ5i5rJ7Ji3tV/4bXiQZ4CXCp PLgaUEhP0vRi6Ye/vHQqLwNSDdkZXw1E8PdI1q/FDmAyD+RLJchtd+4GZowbDb6o/Nio MrsED+L4QgY6Y0GfueqJ0oPpU4bNMvMsX7xgQc351SUUqwToSZK+p73zJIcUniPX75KV 9ULB0hvxh+HfFHZA4/PoG70gVfsCyuy/380QKuTbAej/wKinZjOwSxU5OEbUwuFNv2OJ X9kg== 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:references:in-reply-to:message-id:date :to:from:delivered-to; bh=d3XloaaDkdfRb5TaSbRKTxGXMJ4tGCWJUwh5BEol0zA=; b=v8faId/PNPG8HtKOwY9tfagVkNFw7ZT36UCiYsICqFuyS+KelzlB3MojzMzShXh2EM bsCR9Kv6lVb/O4CD1eBr1aq4wq86RJLp83JLNAJMEK/Vcv3UI3MEAERHReZgDHntmwqe CcCH0wQmWjsBXpdnbq6fEE1IOVwJCZ4BbEHQpQAc/IVDIEOO4s7mNHoaopNc4VPRKpNg rUfCju2ipyLZ0D18El8Sqhedk+kPAk12tP+GAfS/e3Km0gE9a9O5HruvW769yWU6hBge K819RRyHn6iabnIWB93AywvAGG669DnUwzy3y4m/KGxMZWLIS3QAht2BPfR927SnFd0v 89EQ== 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 m12si7624384edd.470.2021.09.17.12.57.29; Fri, 17 Sep 2021 12:57:29 -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; 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 0608868B0A5; Fri, 17 Sep 2021 22:57:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe05-3.mx.upcmail.net (vie01a-dmta-pe05-3.mx.upcmail.net [84.116.36.13]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CC2B9687F99 for ; Fri, 17 Sep 2021 22:57:17 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe05.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1mRJz3-006Up7-0G for ffmpeg-devel@ffmpeg.org; Fri, 17 Sep 2021 21:57:17 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id RJy5m6NWMljeHRJy5mufDA; Fri, 17 Sep 2021 21:56:17 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.3 cv=BoHjPrf5 c=1 sm=1 tr=0 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=nZOtpAppAAAA:20 a=RQ6tB2hilBNp_P6iCXgA:9 a=1fhp2MxaeJtTNGEnv6mo:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 17 Sep 2021 21:56:14 +0200 Message-Id: <20210917195616.25061-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210917195616.25061-1-michael@niedermayer.cc> References: <20210917195616.25061-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfDRdcJI1BQsvfACCGoj2fsI1m1Eltg9dnbuZkuqeg6uxhms2fhzwoc+L0wAFOY9eNN4qLcKhc3OhQfz30GaWadgRXsuz+zKHCf0g1DdRsRgtdM00QRwe VA3rzx9p+Jh92ooscpkww2yj7Sud4ZxrlzxQr6SMwZvDhu366Nz4vFf6 Subject: [FFmpeg-devel] [PATCH 2/4] avformat/dhav: do not use zero fps X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: gjo5aRt+jNp6 Fixes: assertion failure Fixes: 38332/clusterfuzz-testcase-minimized-ffmpeg_dem_DHAV_fuzzer-4522405595316224 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/dhav.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/dhav.c b/libavformat/dhav.c index 5ae39a2a64c..f67b0b89ac9 100644 --- a/libavformat/dhav.c +++ b/libavformat/dhav.c @@ -315,7 +315,7 @@ static int64_t get_pts(AVFormatContext *s, int stream_index) if (diff < 0) diff += 65535; - if (diff == 0) + if (diff == 0 && dhav->frame_rate) diff = av_rescale(dhav->frame_number - dst->last_frame_number, 1000, dhav->frame_rate); dst->pts += diff; } else {