From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 29E6844D32 for ; Sun, 20 Nov 2022 02:34:15 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EFB9468B14E; Sun, 20 Nov 2022 04:34:11 +0200 (EET) Received: from degawa.com (174-127-109-95.slc.westdc.net [174.127.109.95]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D767468B080 for ; Sun, 20 Nov 2022 04:34:05 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomderp.com; s=default; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ro9AY2FPiIc3CL+AEltyHQjGyYyGnHtuSghtq5h4xW8=; b=lkUI2gE6EYBKU1PWtcy9KA2IEf jWJDe8j0SIlvCEkxroV1JsIU9AakVUi9dLyR9z+3Y4ub2tgY9hMWhdT01Pf8awgZSzHLb9+kMD1cj gnJ3H8UFJ7yEuGHFd1esiomRR3k4UI1GUYvFkzDrtF/MCpF+3nWfPHKVvjvIftgPppGUDO7s0NlNf TbmJbXstJ9/sNqz+J1GI2Gtc9NNM4rqGS9VJUnqq4UKOsOHk+2OHTEfjxSqTUt7E+y+NdY/5NmOLE lq5U8+heyhEOujNTC3EnMkhkoiSyePUTNd8P4dflgadsjVwPSuQko1skrvSVwBjBC9Nxbz4rRYFzo GHToiZwQ==; Received: from 108-216-168-194.lightspeed.mmphtn.sbcglobal.net ([108.216.168.194]:34148 helo=localhost.localdomain) by slmp-550-1.slc.westdc.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1owa9l-009KZW-HE; Sat, 19 Nov 2022 19:34:02 -0700 From: Christopher Degawa To: ffmpeg-devel@ffmpeg.org Date: Sat, 19 Nov 2022 20:33:50 -0600 Message-Id: <20221120023350.1684083-1-ccom@randomderp.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - slmp-550-1.slc.westdc.net X-AntiAbuse: Original Domain - ffmpeg.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - randomderp.com X-Get-Message-Sender-Via: slmp-550-1.slc.westdc.net: authenticated_id: ccom/from_h X-Authenticated-Sender: slmp-550-1.slc.westdc.net: ccom@randomderp.com X-Source: X-Source-Args: X-Source-Dir: Subject: [FFmpeg-devel] [PATCH] avcodec/libsvtav1: guard against bit_rate being zero 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 Cc: Christopher Degawa Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: division by zero occurs if it's not specified Signed-off-by: Christopher Degawa --- libavcodec/libsvtav1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c index 48cd58a0b3..06874dfa63 100644 --- a/libavcodec/libsvtav1.c +++ b/libavcodec/libsvtav1.c @@ -179,7 +179,9 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param, param->min_qp_allowed = avctx->qmin; } param->max_bit_rate = avctx->rc_max_rate; - param->maximum_buffer_size_ms = avctx->rc_buffer_size * 1000LL / avctx->bit_rate; + param->maximum_buffer_size_ms = avctx->bit_rate + ? (avctx->rc_buffer_size * 1000LL / avctx->bit_rate) + : 0; if (svt_enc->crf > 0) { param->qp = svt_enc->crf; -- 2.38.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".