From patchwork Tue Feb 23 13:40:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Kelly X-Patchwork-Id: 25919 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 07A2B44ABAB for ; Tue, 23 Feb 2021 15:41:05 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E739268AB60; Tue, 23 Feb 2021 15:41:04 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B4C0F68AB33 for ; Tue, 23 Feb 2021 15:40:58 +0200 (EET) Received: by mail-wm1-f73.google.com with SMTP id z67so1217319wme.3 for ; Tue, 23 Feb 2021 05:40:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=VLR5mFpv2U13gWw2YtaPyz8KsnJZJWePPW2zutRm46Y=; b=qIXo9tmwgrcD5tVgyt/WG8Kt0yNHZAXt4Tc00WHQOciDMAg5fBypAdnYkCgoxAHlVY 78y9Iy8RcloHei3m/5TuEG1GUXkvnHrT9p3Keyub7ZD5JJcfHTgmLIDZ4iNiTvSpzWI4 klqfSq505Xe960BI8dygksg8IzoOz+V/HFquqzHDLRD88dR2j5TJfAKSii6trWwhZRMO twrPyjUI1NQ/OiJQnCJqq0PDHupxygYlXnFp9Aq7qeb/tV8N4GkiIddoyLNJA1aMQ2YS 3GfM+3Rb1FAYmE7XmAF+XsPtgyM4P8NjQ/ZbS0R3DOzGGFa/YqmQS8G6oQo3ONxRv8w3 4RYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=VLR5mFpv2U13gWw2YtaPyz8KsnJZJWePPW2zutRm46Y=; b=ZyDrJR0ycbet3AK6dPm1PcXoZ38pIsqUUngFrt+r0Q8PTZlVlLFuIkBSbZ4lu2Wczp RckM1iOtb864neqseo39ptSvoEm1fTgeCaFVH8g/zzVTIJVoftrw6MJFQtfdGeeWQKEK onLIHnC2jlyt5pYmj5NZbJJrC16ChTfugaN5NEdx/NLqbxee6a9N2uiN8PxE/qXnF+5/ I59SRazMYTk3fBE6Q+sN1zp3aNsnMheun5DJ3Nr4lvEI8vI777V1kVpOaPbd0UYXlGRg THyIsgiQ3b4PbN/7hxYf/XTOK4Fn5FjpI2nXB7lM0boJawctLmZ/9QDWy5TcrtAWQsEV ycXw== X-Gm-Message-State: AOAM533K3Ib+AXmkJF2ts8lMKIQBRD3DQqXxSydTrP/AkQlugxY7FIzd nMbf1Lm6lX3EKhE+dVjNfROqu7+LoWbOSN9dmzDWgG5vAFFNLRlGoEz5LtWnO0KjH/YFC0qfc3i jS3JEAC9DS/5QE2IGftoMolxS05gMah/1l5i3GbP/0gGqo5JaczRyNeDwBGMssJ6+RUkuE44= X-Google-Smtp-Source: ABdhPJxQad1BeUkRgfZRRwxbl/ibFkxWlari+9CjJplC0JJpL0YDPC2WXSZGhrJrpz/4blhCaf4Gf6ZVpqmFJ94= X-Received: from alankelly0.zrh.corp.google.com ([2a00:79e0:42:205:f103:c0d9:882a:4eb4]) (user=alankelly job=sendgmr) by 2002:a1c:3546:: with SMTP id c67mr1433930wma.1.1614087657877; Tue, 23 Feb 2021 05:40:57 -0800 (PST) Date: Tue, 23 Feb 2021 14:40:46 +0100 In-Reply-To: <20210223134047.1834787-1-alankelly@google.com> Message-Id: <20210223134047.1834787-2-alankelly@google.com> Mime-Version: 1.0 References: <20210223134047.1834787-1-alankelly@google.com> X-Mailer: git-send-email 2.30.0.617.g56c4b15f3c-goog From: Alan Kelly To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 2/3] libswscale/x86/swscale: Only call ff_yuv2yuvX functions if the input size is > 0 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 Cc: Alan Kelly Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libswscale/x86/swscale.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c index 1e865914cb..71961a9ae0 100644 --- a/libswscale/x86/swscale.c +++ b/libswscale/x86/swscale.c @@ -206,7 +206,8 @@ static void yuv2yuvX_ ##opt(const int16_t *filter, int filterSize, \ const int16_t **src, uint8_t *dest, int dstW, \ const uint8_t *dither, int offset) \ { \ - ff_yuv2yuvX_ ##opt(filter, filterSize - 1, 0, dest - offset, dstW + offset, dither, offset); \ + if(dstW > 0) \ + ff_yuv2yuvX_ ##opt(filter, filterSize - 1, 0, dest - offset, dstW + offset, dither, offset); \ return; \ } @@ -224,7 +225,8 @@ static void yuv2yuvX_ ##opt(const int16_t *filter, int filterSize, \ yuv2yuvX_mmx(filter, filterSize, src, dest, dstW, dither, offset); \ return; \ } \ - ff_yuv2yuvX_ ##opt(filter, filterSize - 1, 0, dest - offset, pixelsProcessed + offset, dither, offset); \ + if(pixelsProcessed > 0) \ + ff_yuv2yuvX_ ##opt(filter, filterSize - 1, 0, dest - offset, pixelsProcessed + offset, dither, offset); \ if(remainder > 0){ \ ff_yuv2yuvX_mmx(filter, filterSize - 1, pixelsProcessed, dest - offset, pixelsProcessed + remainder + offset, dither, offset); \ } \