From patchwork Sun Jun 3 00:44:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 9231 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:11c:0:0:0:0:0 with SMTP id c28-v6csp2382729jad; Sat, 2 Jun 2018 17:45:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIKCUG+uy5Ihw1Pd7vNaJGgV3onsLKD+sKt4mwFcgEssc/Fb9Pw9Hz2e4YmoL6ujpktdBhZ X-Received: by 2002:adf:cd85:: with SMTP id q5-v6mr11714819wrj.275.1527986723222; Sat, 02 Jun 2018 17:45:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527986723; cv=none; d=google.com; s=arc-20160816; b=U2vfpVLXHLxJJCarQcjUvO1yfGpsrnX1H1OAnGr0iism+Ru4Yu19//Dqpt9bpiKq8g 81scus6FadaKqx1qYIXHtHC49DSbX7apyaB/Hiz8oab6Svo9tYtCZmcRknBvz3EhPa8E 9oIK2m3J0sQ2OtFecggC1oAAavJdbKerqt/DxPNU92cQh9xvZP88ijJBiOUL+CYwNlCe 8bmxISpqjFED5l9vh+89Qc0qrYtXA8csJFDNyESJID0k7HWkj6/lFBcwsfnoYSyETQhI +u2NFulml6q/MD9Qbnr0Q5FblCU2eThsVClasW2WJk/PYN8Cg2IhQL3BAInBffi6u91u xwhA== 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:arc-authentication-results; bh=Xw2inQx3WT4ErtqeBJevAnVI6DjZILbjIvqW2DM452w=; b=KOq9WAUBnphGyU3AH6cT+69TgIKBWO9oQS6vgYoRxEIKYQlsgRTuKTyvA1GV1mI7VE xk7TxXDvXKs1rnf0+gj6MIEZQNrL1AZhx2hqZbqanCUqqEPQKrakrB5WcrCSpE7/cpdb qwbDAAyNiVqQAgb+nUqUiKr8FkzyJErjoBEUAGrexXCEO942IRlhq29byqAdVRuUL5CN FDPg/3FASPx4Cuy6rgMJJypQyiV3xDIaz+0Y5/cYaNwxI0P82+VBHtlnssD0PNAc/5fT R2Htfj8ubcD7oqHlpG89EiKaa29bG3nacEo8md2GYa/c6yUgq8ICtOiYp0zrPRWff+e+ Cz1A== 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 v38-v6si23242339wrb.114.2018.06.02.17.45.22; Sat, 02 Jun 2018 17:45:23 -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 4AAD9689D8B; Sun, 3 Jun 2018 03:44:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe02-3.mx.upcmail.net (vie01a-qmta-pe02-3.mx.upcmail.net [62.179.121.183]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 29CBB689D8B for ; Sun, 3 Jun 2018 03:44:26 +0300 (EEST) Received: from [172.31.218.46] (helo=vie01a-dmta-pe06-1.mx.upcmail.net) by vie01a-pqmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fPH8x-0006tQ-L0 for ffmpeg-devel@ffmpeg.org; Sun, 03 Jun 2018 02:45:11 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe06.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fPH8r-0003Y7-7y for ffmpeg-devel@ffmpeg.org; Sun, 03 Jun 2018 02:45:05 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id u0l21x00S0S5wYM010l3Sv; Sun, 03 Jun 2018 02:45:03 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 3 Jun 2018 02:44:46 +0200 Message-Id: <20180603004446.10158-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180603004446.10158-1-michael@niedermayer.cc> References: <20180603004446.10158-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/opus_silk: Change silk_lsf2lpc() slightly toward silk/NLSF2A.c 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: runtime error: signed integer overflow: -1440457022 - 785819492 cannot be represented in type 'int' Fixes: 7700/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OPUS_fuzzer-6595838684954624 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/opus_silk.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/opus_silk.c b/libavcodec/opus_silk.c index 344333cc18..2fcbf3b9d3 100644 --- a/libavcodec/opus_silk.c +++ b/libavcodec/opus_silk.c @@ -239,8 +239,10 @@ static void silk_lsf2lpc(const int16_t nlsf[16], float lpcf[16], int order) /* reconstruct A(z) */ for (k = 0; k < order>>1; k++) { - lpc32[k] = -p[k + 1] - p[k] - q[k + 1] + q[k]; - lpc32[order-k-1] = -p[k + 1] - p[k] + q[k + 1] - q[k]; + int32_t p_tmp = p[k + 1] + p[k]; + int32_t q_tmp = q[k + 1] - q[k]; + lpc32[k] = -q_tmp - p_tmp; + lpc32[order-k-1] = q_tmp - p_tmp; } /* limit the range of the LPC coefficients to each fit within an int16_t */