From patchwork Thu Dec 7 16:39:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 6587 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp8502912jah; Thu, 7 Dec 2017 08:39:57 -0800 (PST) X-Google-Smtp-Source: AGs4zMaLMcJCARl+PWdzrhZ7UUkATe7+N7eB/Ocg2dmZLE9RHJevxgOqNvPD+MTWC49CG8IDGtC2 X-Received: by 10.223.151.34 with SMTP id r31mr24119924wrb.164.1512664797881; Thu, 07 Dec 2017 08:39:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512664797; cv=none; d=google.com; s=arc-20160816; b=BJSiSBixUPhg7LlFHGKqrwaBfjED4gMaHT7TQg2+/EmIe6k52xJlzzUwScU719yakF as4SdlzOypcfdSOBCd8a7TUsOKpqiIJ7hfySpp4SPxMZZDYLvoq8txaf/GFVrbsF0z// Y1aJkC0iEVERV3E+0LWc60wwLOgWdUa7j0zZN9GSqaUh61v94r0durmcKhIFpPCnvsaq DMEDr5Qxa7Mv2XA172f7sWfqmW+H3pzSN4wSv7bF+mnztraXXK8Dhf3LYcvK0pYmsSAc Gu70WqC5Jd0/F37i2UN1X3CFhexRcYRvlt/76UqNRjM0LXNTBQBc6Hbv/CYWmoU19Bz4 jzPQ== 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=/SQji2+oxOrYMB5lHhWtMfIAVqHc8/Ss6C7OrUcSY+c=; b=Lzame1d8QgBe1F8vLQXyqpuaBujsgx5xUA6cpo2JtV4hVUGAD1pzA7IvVkFnD8YMAN HXY57FG/8AqB5dUJWURmsSSIKsmuNY1P3NP0ucoL39gtW0t1J4ubKXPHk/W4R/dSn1YK MsIMohAVSFada1gaL24QrA1P0scEbSXyxhyixe4ITxQNAR9VqFtkeP7+8sQNzGs/fGZD CJ0i4nv1auxsl/QMDin4oWyIoNhbIbeerR3L+rGBTzIkpBWMXaDqpkkyHfQsqd2RGquA iDASXJYIsln/aXI2VcIk+anUQRQ9po3BudcK+KBVrapn2yYtcGsGiE1ieYwjzOVgP3e1 DlLQ== 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 j142si3953872wmf.33.2017.12.07.08.39.56; Thu, 07 Dec 2017 08:39:57 -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 A103668A313; Thu, 7 Dec 2017 18:39:49 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe02-1.mx.upcmail.net (vie01a-dmta-pe02-1.mx.upcmail.net [62.179.121.157]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2C74868A1FE for ; Thu, 7 Dec 2017 18:39:44 +0200 (EET) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1eMzDB-0007Th-Or for ffmpeg-devel@ffmpeg.org; Thu, 07 Dec 2017 17:39:49 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id j4fi1w00X0S5wYM014fjnq; Thu, 07 Dec 2017 17:39:43 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 7 Dec 2017 17:39:41 +0100 Message-Id: <20171207163941.3802-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.15.1 Subject: [FFmpeg-devel] [PATCH] avcodec/amrwbdec: Fix division by 0 in voice_factor() 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" The added value matches "Digital cellular telecommunications system (Phase 2+) (GSM); Universal Mobile Telecommunications System (UMTS); LTE; Extended Adaptive Multi-Rate - Wideband (AMR-WB+) codec; Floating-point ANSI-C code (3GPP TS 26.304 version 14.0.0 Release 14) Extended Adaptive Multi-Rate - Wideband (AMR-WB+) codec; Floating-point ANSI-C code" Fixes: runtime error: division by zero Fixes: 4415/clusterfuzz-testcase-minimized-4677752314658816 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/amrwbdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c index 57aed874cc..7f2874d35f 100644 --- a/libavcodec/amrwbdec.c +++ b/libavcodec/amrwbdec.c @@ -611,7 +611,7 @@ static float voice_factor(float *p_vector, float p_gain, AMRWB_SFR_SIZE) * f_gain * f_gain; - return (p_ener - f_ener) / (p_ener + f_ener); + return (p_ener - f_ener) / (p_ener + f_ener + 0.01); } /**