From patchwork Sat May 29 15:58:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 27984 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp1483959iof; Sat, 29 May 2021 08:59:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyadSwERWLo7eO9WIMq6Jogg+WgC/OLMuJ9h79WGCZokjwrUr9TzFmRoDbV59ZlMbPgoxWb X-Received: by 2002:a17:906:7fd9:: with SMTP id r25mr14717267ejs.417.1622303971223; Sat, 29 May 2021 08:59:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622303971; cv=none; d=google.com; s=arc-20160816; b=nG+FGLs/kelexZyoe4CvkN/MnVEjKkKBQQO74+u1FEA3Ja9erR8xupH2/hHpIizgeE aoHbqbwutUFJUEQcvvh9i+UzUPE82uMdz0Uc7Yf+S4w8AcAUQJSiLp7ZPRkantSaKyBP eSL92hIfwAGFdl0x42SdzIEQ2iusi929LLil9f2WkYbeXssRzQB0RqFyWNH32VcTh+Tx V5RbZSffO5UJjbE+4wRwmA4IzXUds9jVADJSzcIEfBi3cFh+A2yrQwqgzlasmk1UbqPO qs00EK3dPTTAlvR4PYPGW/NyfhC518cpG92Rr7G8KekT4nsONNVdnxibY4JcVRuUCQ7A dS7w== 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; bh=H6EafVesxtbsomrBaK2YG3h/KjpMguf1LYCHGu1mjjU=; b=rMLv0J+t+hkNdSvw1bYBAt1WzXelI4vPxKGFL9V3S9+X1pwEoYdMBMNuxscKyaPmin FQwKf1FwGUHWzTH3ruC5u+I6U2OJY8zdcz5thOuXZ1sLsuh38OlyLCYlVisQGUhoMgrQ ZsDpGhh76p7Rvq5oNnI5ZdZwPArxOwIEn9lCmUZVLOUJvngSERaNwvjNYDheIe0ch7XT /Pvbe+KT2R+nFrv1g/5Njqnuqh3KYh9A8qs7b2CXjmWWfNjDazGD57YaCKPcKhJQJNcO eHkgBfErl5Cnm2qppuFSkZrlM8bs+p4pkID+aQ136BqG5S6xN04DMNJ+iqGZN+5newhJ 0hrQ== 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 i18si4021244edr.251.2021.05.29.08.59.30; Sat, 29 May 2021 08:59:31 -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 756C46808D9; Sat, 29 May 2021 18:59:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe01-2.mx.upcmail.net (vie01a-dmta-pe01-2.mx.upcmail.net [62.179.121.155]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B01136805CF for ; Sat, 29 May 2021 18:59:19 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe01.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1ln1Mt-0072dA-0g for ffmpeg-devel@ffmpeg.org; Sat, 29 May 2021 17:59:19 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id n1LulMB6iljeHn1LulNvmz; Sat, 29 May 2021 17:58:19 +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=Rsc4I35CJhffDfqw8F0A:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 29 May 2021 17:58:17 +0200 Message-Id: <20210529155818.27398-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 X-CMAE-Envelope: MS4wfALLPTGoxZd70Cpd9TJM/L9AmdRCqMrrlptckde5efb+scYqBqvD29BViRBAvgMW0I/pB2Vq5Cfp8+iSn4Pi4D1QZHaAyGaVc1gCLeyKNkMv2xvoq+UD nIkAVmfW0pm/G5e4PPNAlr4o4izCngV8qc9k0p+Dr5IM1tP7iesXdPrb Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/aacenc: Do not divide by lambda_count if it is 0 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: m3W8sd3QksFy Avoids Floating point division by 0 Fixes: Ticket8011 Signed-off-by: Michael Niedermayer --- libavcodec/aacenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index e80591ba86..49feb86b3f 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -898,7 +898,7 @@ static av_cold int aac_encode_end(AVCodecContext *avctx) { AACEncContext *s = avctx->priv_data; - av_log(avctx, AV_LOG_INFO, "Qavg: %.3f\n", s->lambda_sum / s->lambda_count); + av_log(avctx, AV_LOG_INFO, "Qavg: %.3f\n", s->lambda_count ? s->lambda_sum / s->lambda_count : NAN); ff_mdct_end(&s->mdct1024); ff_mdct_end(&s->mdct128); From patchwork Sat May 29 15:58:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 27985 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp1484041iof; Sat, 29 May 2021 08:59:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4NQdVJQ9JXtxH/lApEcZLQQ1bALP+ijBUzLC6KzLEbyj6S8ZJ0LROYVFA/5bJJGX3vR5U X-Received: by 2002:aa7:de99:: with SMTP id j25mr16267894edv.91.1622303981684; Sat, 29 May 2021 08:59:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622303981; cv=none; d=google.com; s=arc-20160816; b=V8olJxTAOrrz9ZmAJCuEWAj+pm4KkTlsZKlT6p/0CcbmteCHfkVg9a04HY0t+VSYZH rQUaVMVGhbe49VZoAgnuOPvJ1HsOhyHldAcsGdNhAbJ1HxRf/YV4FqlzxDkfSB++JPOy Ksu4DjVMyz2I5lgsHcQUcYCBN4IoFzzNAqMliORY5zZ7n2vd9T6stCN3DbNEcwBI5mkQ Qj8N2ALI2O3vwFPMA/7uVuNAYfqo+gGRkhpQFNo9iiwtFG51UcBKHr+NwnJ1PApb1PpH hTh/+z+UqoS9/RPirYmCquldRSSbkse9qdo85kzMYIbDx45goM8QmLur+U7W3OG4H2WE Uwbg== 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=9K3TIlhoPKWOlZLINv4/+XTGqb+mlIJaLKPVFg77JEU=; b=BA4jaoSVMccbd+qL9MbdKY1M0vWeIlUNBUOog9z36onAR/jonqcWEXxdrLEjGsaNs/ L5pNZ6t0VdhfrKvavXE4YlUtsRnC/bGvv0TPqtLM0ST6U5+szMlH9GFXPJrtV+l4JGXt LgCnW7C6qPgBXyLThNOvDF+vTUKkeu0iYM0fYlGSc7YCGydhKj6qyAz17roaIBmrR8v0 jlJE5QgW6XMpWhE7iwoKqGkPPmj02HOVsTL4gczPEwjSXVPDd/f6RzrHOtP0qiozdcLW J0cfZdr1tCuGaagJNHSmOn+BPaDeOq+GRI6CnzSEV4KEoejk127jH9j/le4UfppG3uPK wPfA== 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 t19si8157735ejb.193.2021.05.29.08.59.41; Sat, 29 May 2021 08:59:41 -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 7A8FB687F20; Sat, 29 May 2021 18:59:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe05-2.mx.upcmail.net (vie01a-dmta-pe05-2.mx.upcmail.net [84.116.36.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DA5546808D9 for ; Sat, 29 May 2021 18:59:19 +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 1ln1Mt-00G5sv-0e for ffmpeg-devel@ffmpeg.org; Sat, 29 May 2021 17:59:19 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id n1LvlMB7EljeHn1LvlNvn9; Sat, 29 May 2021 17:58:19 +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=Cdo-w9eOrYnC6vizP90A:9 a=pHzHmUro8NiASowvMSCR:22 a=Ew2E2A-JSTLzCXPT_086:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 29 May 2021 17:58:18 +0200 Message-Id: <20210529155818.27398-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210529155818.27398-1-michael@niedermayer.cc> References: <20210529155818.27398-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfALLPTGoxZd70Cpd9TJM/L9AmdRCqMrrlptckde5efb+scYqBqvD29BViRBAvgMW0I/pB2Vq5Cfp8+iSn4Pi4D1QZHaAyGaVc1gCLeyKNkMv2xvoq+UD nIkAVmfW0pm/G5e4PPNAlr4o4izCngV8qc9k0p+Dr5IM1tP7iesXdPrb Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/aacpsy: Check bandwidth 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: 4gMM/4yqOZqo Fixes: Ticket8011 Signed-off-by: Michael Niedermayer --- libavcodec/aacpsy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c index e51d29750b..487b84fd85 100644 --- a/libavcodec/aacpsy.c +++ b/libavcodec/aacpsy.c @@ -308,6 +308,9 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) { const int bandwidth = ctx->cutoff ? ctx->cutoff : AAC_CUTOFF(ctx->avctx); const float num_bark = calc_bark((float)bandwidth); + if (bandwidth <= 0) + return AVERROR(EINVAL); + ctx->model_priv_data = av_mallocz(sizeof(AacPsyContext)); if (!ctx->model_priv_data) return AVERROR(ENOMEM);