From patchwork Sat Jun 3 17:04:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 3820 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.10.2 with SMTP id 2csp684949vsk; Sat, 3 Jun 2017 10:05:07 -0700 (PDT) X-Received: by 10.223.135.227 with SMTP id c32mr10444781wrc.10.1496509507336; Sat, 03 Jun 2017 10:05:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496509507; cv=none; d=google.com; s=arc-20160816; b=xL8oMVrO7I0cwhgnkSwF4VQe/CpERIiMTx3G62bwc64KOwvOSGyoEVJkqp3+l7AOwn 1cc8kpyTiCpqeZjxvpwHmgx+YlxL1GsuA0PZy+EgOD9rb0JayVNTIOxZ1APfC1MLu6Xd /zqvQ0jmX1ASjwnVsnCw6tn3H9mRJl2HP7KoO0zRRNdiyto1m23LqyGcL1BF4tcgaSVW 4JiMUJ9ALvGMXHZHqgYCxIZwgTxIxEoMuwPluY7YbN9v0B4kM0BzwppQu4Bl0Zs+P+x+ ZhkivcigrlrErGUoNTLn7tCyXTrEDSp6nS1KvXcxOpW2xb4XC8Iicy3yz4/DqBJKF0Q2 td1Q== 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:dkim-signature :delivered-to:arc-authentication-results; bh=LPKD1jin6Sf412kTCpR0Xgjs0/m6goV8RtIezFsojn4=; b=qPwvraTeeKrYGQXzt3zeZIbF8i9JF4yksyjE6GBFppuvHilIlL+cfWm7Aq28mOm6fv 3N8MkPQVerY+hknaNpWCWWrllacfVtrUlYvXHFCzaH1EfWeX54szdjmDDRR82+OS+QVn h0LBtamgO96MILzpJbjZG1BCBfqGotRIp14cXLFBvod7y5ROxeWidN66W/+rTHSYi2RK 4gWnGIktqMxmRly3vZHVQxlzClh6DWL7nAzK+HiXJefc1TVZ8IES6SCqZyAT7VFHuf1Y 86xXyLVrhz9C4F9lQUX+/ppNH6clPPN17apqsYGwAi0g6P6wbmSasmK764Fcw5JFAmBk Dzwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n205si882666wma.15.2017.06.03.10.05.05; Sat, 03 Jun 2017 10:05:07 -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; dkim=neutral (body hash did not verify) header.i=@gmail.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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 987D5689C4A; Sat, 3 Jun 2017 20:04:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk0-f195.google.com (mail-qk0-f195.google.com [209.85.220.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CB1C0689A5D for ; Sat, 3 Jun 2017 20:04:50 +0300 (EEST) Received: by mail-qk0-f195.google.com with SMTP id v195so13129406qka.2 for ; Sat, 03 Jun 2017 10:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=DFOIPXaqK/awMDuJ7t+2iu+gLBoln8vW8VEOgTWT51s=; b=mgzCmWvqD+sIZBu4ag5yP14pM3/12Vb3XtWGoMK11Q4kQv9zREwvZ3xJf/h+x99Zuw KTyMeIhWlDllORlfmDkCBVwIciRKH80Upj9mHEbBJWdwyitfGu1iyCMnZ/fc2MmhwJCm 24kgt2eAAcqzBxgqMBevHe53X9KdL4/6BL+38medIz3e06vuyJyiMI+9btg7gifIj8Q7 h7pD5V9WwxRP4AjgtNyoAMbERaSdE2x4TrUZPU56q8dXGOHxF+sNnqSwxqd07MFs3xUH aNipYwl+4TXLTj6HuzibqCdPsEHfrOmztfjNhNjyW0pD6P6dRi971h6QEGMk+4XjiK1w rgoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=DFOIPXaqK/awMDuJ7t+2iu+gLBoln8vW8VEOgTWT51s=; b=L2O5wrmERdMyKlIJc8rWJPSFon3f4YOrIMwFyHXZBl2JOnvzafsDH7s6nKh6gOcksZ ZEGUgLpDGINpoQDpE2xThxCiEUp66rB9kUvaerC9itedWHpuG8QGWRqBEG++kOIwUGRf Cs5gXCR9nOxtPkGGt9LFbXicSWSNp/5fWmm/7HspjM7a+MHvJsukYnVEC9RQEwfnevwl jKHfaopXJDKacbGqx2xXn8iHZyUSYhurexk1lQBZaJwVvRE0P75R/rVXROY3yg7UMa+F EMMBW+4rySVvmTaVm/f82zdYQxMWpC9lxt1CfOQm+TLUYWVDblAwpCEyHdvhOgNMJBWJ ax+Q== X-Gm-Message-State: AKS2vOwRD6FzHX6Dn28QPEqznAh/A7GNswUDCfg50Os3Rnt7KqCsHsYJ h21C8aeKASP2Q7ok X-Received: by 10.55.21.230 with SMTP id 99mr15247396qkv.212.1496509495587; Sat, 03 Jun 2017 10:04:55 -0700 (PDT) Received: from localhost.localdomain ([181.231.116.134]) by smtp.gmail.com with ESMTPSA id a36sm6225479qtc.42.2017.06.03.10.04.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 03 Jun 2017 10:04:55 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sat, 3 Jun 2017 14:04:31 -0300 Message-Id: <20170603170431.4300-1-jamrial@gmail.com> X-Mailer: git-send-email 2.13.0 Subject: [FFmpeg-devel] [PATCH] avcodec/aacps: move checks for valid length outside the stereo_interpolate dsp function 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" Signed-off-by: James Almer --- libavcodec/aacps.c | 7 ++++--- libavcodec/x86/aacpsdsp.asm | 6 ------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/libavcodec/aacps.c b/libavcodec/aacps.c index 29de8a5ea7..473da7bd43 100644 --- a/libavcodec/aacps.c +++ b/libavcodec/aacps.c @@ -979,9 +979,10 @@ static void stereo_processing(PSContext *ps, INTFLOAT (*l)[32][2], INTFLOAT (*r) h_step[1][2] = AAC_MSUB31_V3(H21[1][e+1][b], h[1][2], width); h_step[1][3] = AAC_MSUB31_V3(H22[1][e+1][b], h[1][3], width); } - ps->dsp.stereo_interpolate[!PS_BASELINE && ps->enable_ipdopd]( - l[k] + 1 + start, r[k] + 1 + start, - h, h_step, stop - start); + if (stop - start) + ps->dsp.stereo_interpolate[!PS_BASELINE && ps->enable_ipdopd]( + l[k] + 1 + start, r[k] + 1 + start, + h, h_step, stop - start); } } } diff --git a/libavcodec/x86/aacpsdsp.asm b/libavcodec/x86/aacpsdsp.asm index 4548bb4257..1eb0136b81 100644 --- a/libavcodec/x86/aacpsdsp.asm +++ b/libavcodec/x86/aacpsdsp.asm @@ -91,8 +91,6 @@ INIT_XMM sse3 cglobal ps_stereo_interpolate, 5, 5, 6, l, r, h, h_step, n movaps m0, [hq] movaps m1, [h_stepq] - cmp nd, 0 - jle .ret unpcklps m4, m0, m0 unpckhps m0, m0 unpcklps m5, m1, m1 @@ -115,7 +113,6 @@ align 16 movhps [rq+nq], m2 add nq, 8 jl .loop -.ret: REP_RET ;*************************************************************************** @@ -125,8 +122,6 @@ align 16 ;*************************************************************************** INIT_XMM sse3 cglobal ps_stereo_interpolate_ipdopd, 5, 5, 10, l, r, h, h_step, n - cmp nd, 0 - jle .ret movaps m0, [hq] movaps m1, [hq+mmsize] %if ARCH_X86_64 @@ -166,7 +161,6 @@ align 16 movhps [rq+nq], m2 add nq, 8 jl .loop -.ret: REP_RET ;*******************************************************************