From patchwork Fri Aug 28 22:43:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 21976 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 878EE449580 for ; Sat, 29 Aug 2020 02:48:00 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 626C168AEBC; Sat, 29 Aug 2020 02:48:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4EEB66881FC for ; Sat, 29 Aug 2020 02:47:53 +0300 (EEST) Received: by mail-qk1-f193.google.com with SMTP id p25so1238605qkp.2 for ; Fri, 28 Aug 2020 16:47:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=8dPC7MOZIXMV5bGsFUlT/iXDrZySYVXPXc+17UB2Dq0=; b=otPPRN1Zp7cYwphT69nuEJdxdZfhIwFI2S617PDI6oAnEZPWA25lAVg5U2E3M53iXa L+oqmhxkRRAAx7sLEUpg89fVIilLnjj+FffX5aRluT8L7l8a4f0ZLyh08Gr75Rfp2pAR PtLmp2JuOJIln2ibkvIwmCmGf6nAzjEJKMo8QfYIvT0UFyJBcSHSslLtawJVmNmWHBOo x6by0PhSnVyXt69mos041d14tzn3y9hFeRvSobDrOjVzKV+bjlJBaLc/ZV1f+7hanJSi n5mwL+jEHg9E7+n57ZYTUWGTTXFgMPaQzPGLqLlDJIAGgmSI9eX6TPSpP4qmVNnGxNq2 e1/Q== 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:mime-version :content-transfer-encoding; bh=8dPC7MOZIXMV5bGsFUlT/iXDrZySYVXPXc+17UB2Dq0=; b=PX7ehP+tlZOiQO+ixPDt9/zMK82+7yofrFhU4kUYB4itoSPLZOeCZbhKVFd92OvWsA DG6vDLsCgPEdDZUAJHTTWm412UYZoba5JrPTe1Vl3cFdxtJvza0owMTS7pJsz3BcZ1qH c4Ybh8mtIOLtfZrhGBN3bDl6n5kt7O8hd5DGUXDQ6c6TNFs72ckL5veRdSD4WFE4na1I fx8/tXu6hdIPw9Blhrd5z3Y2u3P8ySXbwnEzdDXfcKbSUhED0vBX/Vs7veRbvTca+/C3 1R9aIIG1KrYsADsCHBTD31kPAwSY2+l6prf2TJ3a7GoIFlhbTZbSB3ewvHBKLzUnWbm6 7Ahw== X-Gm-Message-State: AOAM533BpG27xqG0ybW06Hm0X6wTjG4nkIH7xXZ6Ru9Lb7lpIYtkGMSb gv9oFAaFCYS2Pa5KDm6RYub5hDHKyVw= X-Google-Smtp-Source: ABdhPJwN6iXOJrYUyHnUGLqT35aTWeASbe7JLGwqg7qQHmw8KG5cGRsQLsQ6XgPCi7kl3tJdIS/ZXQ== X-Received: by 2002:ac8:2942:: with SMTP id z2mr3676568qtz.376.1598654627889; Fri, 28 Aug 2020 15:43:47 -0700 (PDT) Received: from localhost.localdomain ([191.83.209.2]) by smtp.gmail.com with ESMTPSA id y3sm443677qkd.132.2020.08.28.15.43.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 15:43:47 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Fri, 28 Aug 2020 19:43:30 -0300 Message-Id: <20200828224330.10415-1-jamrial@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] x86/cfhddsp: zero extend int arguments 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" if taken from stack, they may have garbage in the upper bits otherwise. Also, there are only 8 arguments, so don't attempt to load 11. Fixes SIGSEV crashes in some targets. Signed-off-by: James Almer --- libavcodec/x86/cfhddsp.asm | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/libavcodec/x86/cfhddsp.asm b/libavcodec/x86/cfhddsp.asm index 51848677eb..87c2df634a 100644 --- a/libavcodec/x86/cfhddsp.asm +++ b/libavcodec/x86/cfhddsp.asm @@ -37,29 +37,26 @@ SECTION .text %macro CFHD_HORIZ_FILTER 1 %if %1 == 1023 -cglobal cfhd_horiz_filter_clip10, 5, 6, 8 + 4 * ARCH_X86_64, output, low, high, width, bpc - DEFINE_ARGS output, low, high, width, x, temp +cglobal cfhd_horiz_filter_clip10, 5, 6, 8 + 4 * ARCH_X86_64, output, low, high, width, x, temp shl widthd, 1 %define ostrideq widthq %define lwidthq widthq %define hwidthq widthq %elif %1 == 4095 -cglobal cfhd_horiz_filter_clip12, 5, 6, 8 + 4 * ARCH_X86_64, output, low, high, width, bpc - DEFINE_ARGS output, low, high, width, x, temp +cglobal cfhd_horiz_filter_clip12, 5, 6, 8 + 4 * ARCH_X86_64, output, low, high, width, x, temp shl widthd, 1 %define ostrideq widthq %define lwidthq widthq %define hwidthq widthq %else %if ARCH_X86_64 -cglobal cfhd_horiz_filter, 11, 11, 12, output, ostride, low, lwidth, high, hwidth, width, height -DEFINE_ARGS output, ostride, low, lwidth, high, hwidth, width, height, x, y, temp +cglobal cfhd_horiz_filter, 8, 11, 12, output, ostride, low, lwidth, high, hwidth, width, height, x, y, temp shl ostrided, 1 shl lwidthd, 1 shl hwidthd, 1 shl widthd, 1 - mov yq, heightq + mov yd, heightd neg yq %else cglobal cfhd_horiz_filter, 7, 7, 8, output, x, low, y, high, temp, width, height @@ -307,14 +304,13 @@ CFHD_HORIZ_FILTER 4095 INIT_XMM sse2 %if ARCH_X86_64 -cglobal cfhd_vert_filter, 11, 11, 14, output, ostride, low, lwidth, high, hwidth, width, height -DEFINE_ARGS output, ostride, low, lwidth, high, hwidth, width, height, x, y, pos +cglobal cfhd_vert_filter, 8, 11, 14, output, ostride, low, lwidth, high, hwidth, width, height, x, y, pos shl ostrided, 1 shl lwidthd, 1 shl hwidthd, 1 shl widthd, 1 - dec heightq + dec heightd mova m8, [factor_p1_n1] mova m9, [factor_n1_p1]