From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 2909140397 for ; Mon, 23 May 2022 16:06:28 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8B56F68B496; Mon, 23 May 2022 19:06:25 +0300 (EEST) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9B08868B0A6 for ; Mon, 23 May 2022 19:06:19 +0300 (EEST) Received: by mail-lf1-f43.google.com with SMTP id u23so26414357lfc.1 for ; Mon, 23 May 2022 09:06:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to :content-language:content-transfer-encoding; bh=AQXrYdE0/g+0QI/SqxdSbUxi5E5ZEpvdl3GMpVU3FV0=; b=nTsWHIg3orrNy3i+vI7UDZzdIE3de3EKOR8+cbqqVerrPKRLB4+xOyArZ0jrVRzcVK R54396YmBQyfLf/sg68JghZ5noGJ5EdINpGy0xkwDcBtZ39K/skB6fPPX21oXFZX3Br2 sbdHb5BcoLvfHE/xVb/TC7TVy9fyCHs0XcQzlo5j0m7Ve0di+Ot6BP5esEQnKKbPtLXA 4G21V7NVEbXWHduQWcjPdy9Mt7kgw2PWSaqgJyL4Ro4JdyDoYIJwdbXBBU5rxpBsgQn/ 8iKQ98GjhN/O9pbfx7zgNCfxj8aSfNE6Tv6bOTskjTvQBnw+LHmbIn9Z/JsatkdYIh4w myGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:content-language:content-transfer-encoding; bh=AQXrYdE0/g+0QI/SqxdSbUxi5E5ZEpvdl3GMpVU3FV0=; b=7ku0h0PS3HSunr+zldA4jdhSZSoP/ck6ugT1aCG9Q/XwMFom8S+GHF0JPBjBOL8VAv thGu3U/ew3I34Qp8+fgkAdpztBn604rw1aI2UX6FoIa8fqWd+dCbX8m/X7kculrM06RL OWdchK159sVrlkz+CZch7jjZC609YtLtSZ5F6VmNQ6zRZLwvBSeait3O1qPhpiQwchHB aA81rrC9RR63XVsIvUZe/Mtc7Y+ibL3XfCmecq92VI97Dzl2t2Y1Zp7mgzKfVp8vGe0a 8KBcrN1//eULEx0xrt+dQSz3gCiItAitp5ARZdn5M+Np3Cs7pu4qeenVOqo65SZ67+8g NwVw== X-Gm-Message-State: AOAM53392luc6b3oNMRUMX+OLC6/CZcSVChKKC8HXb0hf2TvzzLM23qr +Ng1wDaISglosYRgS0msa/7TUIWMV+KT3HFN X-Google-Smtp-Source: ABdhPJy35haJz9wBJALSm8ryj1Ot+JCzOk50sVFesQGlov6iq0ZXidnV+52rZcoinTKSQZwGnnji7g== X-Received: by 2002:a19:770e:0:b0:478:6df3:a56a with SMTP id s14-20020a19770e000000b004786df3a56amr4412758lfc.419.1653321978486; Mon, 23 May 2022 09:06:18 -0700 (PDT) Received: from [10.0.45.52] ([83.239.225.50]) by smtp.gmail.com with ESMTPSA id o5-20020a2e9445000000b00253da399907sm1906918ljh.114.2022.05.23.09.06.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 May 2022 09:06:17 -0700 (PDT) Message-ID: <6c55b4a0-4c84-a1b9-cdf3-ae3e7e527f68@gmail.com> Date: Mon, 23 May 2022 19:06:16 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 From: Vardan Margaryan To: ffmpeg-devel@ffmpeg.org Content-Language: ru Subject: [FFmpeg-devel] [PATCH] swscale/x86/yuv_2_rgb: fix access to memory past the frame data in yuv to rgb conversion X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Y, U, V data is loaded at the end of the current iteration for the next iteration. It results in memory access past the frame data on the last iteration (that data is never used after the loading). So load data at the start of the iteration, so that only useful data is loaded. Signed-off-by: Vardan Margaryan --- libswscale/x86/yuv_2_rgb.asm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libswscale/x86/yuv_2_rgb.asm b/libswscale/x86/yuv_2_rgb.asm index 2f0b4130df..f968b3a0a2 100644 --- a/libswscale/x86/yuv_2_rgb.asm +++ b/libswscale/x86/yuv_2_rgb.asm @@ -139,10 +139,10 @@ cglobal %1_420_%2%3, GPR_num, GPR_num, reg_num, parameters VBROADCASTSD vr_coff, [pointer_c_ditherq + 4 * 8] %endif %endif +.loop0: movu m_y, [py_2indexq + 2 * indexq] movh m_u, [pu_indexq + indexq] movh m_v, [pv_indexq + indexq] -.loop0: pxor m4, m4 mova m7, m6 punpcklbw m0, m4 @@ -347,9 +347,6 @@ cglobal %1_420_%2%3, GPR_num, GPR_num, reg_num, parameters %endif ; PACK RGB15/16 %endif ; PACK RGB15/16/32 -movu m_y, [py_2indexq + 2 * indexq + 8 * time_num] -movh m_v, [pv_indexq + indexq + 4 * time_num] -movh m_u, [pu_indexq + indexq + 4 * time_num] add imageq, 8 * depth * time_num add indexq, 4 * time_num js .loop0 -- 2.30.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".