From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id C3D424D177 for ; Tue, 11 Nov 2025 04:53:22 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'Rm4A5Nyd62xyosdCIFlERRwLG5Qu2ssUvV3ZAAz+p34=', expected b'1GcgCrVTdzjYlLgs7HX3TsoW+8V+mVhRGkdHEgnlKiU=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1762836741; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=Rm4A5Nyd62xyosdCIFlERRwLG5Qu2ssUvV3ZAAz+p34=; b=GlRQvZV1oHzD25WMdtbAGVpwGKhvHOqquG0lVhQuBoDt6GHc3nuCC1ZnIJduUcL7TAm/m +E5gPKeIzYHTT1/Yywq84Lm6uIE1hQCDAivtL2seB6kdjh+mkIJamkq7zsdZyw9FRhao0Y/ w4iAFwP+JP6C3ofrwAkLhxkoTGlyY0D5w4WPkl7txrm9pgCZjSU10xdRxwSK2loCBNLfAAS NZIMliNj0vXdLnfhOClcmy1s01cOeYZ7wS5kRBJjDjX1E63yxgHC75pz2qt5xZ579Jqlazr XCcUGq+vUP3beB+X/l0fkihfGjoGR/EQc6fZYeZCg03zYBPHzqLLylFyUviQ== Received: from [172.19.0.2] (unknown [172.19.0.2]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 46ECF68FC66; Tue, 11 Nov 2025 06:52:21 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1762836693; b=VRdd1XdLlgDtYUmaNCg1JHv3aTLd9hi0GRm5uLLgUrSe/dro6eoKTHrkARI/5SkS/gqae 77jxb56va7Koz8mWGaKGdac6v4qMa8vtSybVnX9atRceMZ9BGZOxMPsE3pwhATBDdblbOvF qg4tRnIRANF0FjzNxDwpsEdZSmtjmrO1VMXOOFSw/u6wf+B9Ne54sTcI/7pUInjOYPMXC/T kdOKElvJp1MdpSb8YGjI1sbuOjZTLFckb5GX+4WRNHCo1VD3beV7kq0g8EFeo0zNNWlP7pf oZeaqhCGYv2TrpvC18Ek4p/bVgJ+QDTb0j2RslZ+iQLkLl17llRE6IKi5ElQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1762836693; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=UIVQePst7LmuYwdyxiq30t0S5oAgcf8tNH8D3Z10Opk=; b=QY3Khvms+uHguXjMAR1XwHksPP78i+UH0gWZlb+mJlYlPKccdQeBi5FKxJmQmu4wCh7Ay rTtgBBbaC1W64RaLJo2UsFOSxzfMXRuN0j8nrSQiq3+pFyNdZY7Lw8pGOmhi2ZceTTHhkBb 28lxPDUgxwXD7cNjbN1ZuZVRmiqmWgJ/1KK14kGLw5TTUCnOu6SveXRkaHMY1PJzCuCM0Ze cBA54WxwGdqNRLv2zY2ZUUjdDxGvfTghKU5qVgtYU9w7MWEawMqnLdEwjZSYffUM+Gg4KIu FWweugb/1YZbEpOcjCf8FxZmXjRIzZE8V9i030D5TktUBITkgHYoUrL9v5ZA== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1762836679; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=1GcgCrVTdzjYlLgs7HX3TsoW+8V+mVhRGkdHEgnlKiU=; b=Nq2C3+XV3eq6Cj1yyNDB5gsBm0afFQCuG7x23BvqByChJ3x2zNjNS8yDIh84djaNylixu D7l9vMtw1VxojaFVrVJdPGj+kEK7BcdTFMxb08Woj9wxpVtdhYgokcBpq8nWvbVysGXNi0c 6q4y06oW+8GLM017zGQm7dZXJafbbnVFp2jMuDvv3JC+PhDO4q6ewYPYKEJzoR/I0i1kERV 1waWD/v4t58YQC6/gZgm71mnUJQ8cQHUOnGN72F/BCWHjiQADPRt4o7fSMvxo0pbmh+wHRw 9MOE6/voV2PEcv2BlY0P0XViL1b68DFOCWupu588JpWbmxftV8M+5TI/jMOA== Received: from 188d6d40ca7a (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 658E868FBE5 for ; Tue, 11 Nov 2025 06:51:19 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Tue, 11 Nov 2025 04:51:18 -0000 Message-ID: <176283667994.25.4095923926027028554@2cb04c0e5124> Message-ID-Hash: OFAEPNYEELRAXKKRBVOKFCU4WUGHRTPC X-Message-ID-Hash: OFAEPNYEELRAXKKRBVOKFCU4WUGHRTPC X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] swscale/ops: fix ff_sws_pixel_type_to_uint (PR #20891) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: cancername via ffmpeg-devel Cc: cancername Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #20891 opened by cancername URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20891 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20891.patch ff_sws_pixel_type_size uses size in bytes, not bits, but ff_sws_pixel_type_to_uint assumes size in bits. ff_sws_pixel_type_to_uint is never called anywhere, so this went unnoticed. >>From 6c6c9065ba40f2255defe0bf4692e5552c3e511f Mon Sep 17 00:00:00 2001 From: cancername Date: Tue, 11 Nov 2025 05:46:08 +0100 Subject: [PATCH 1/2] swscale/ops: fix ff_sws_pixel_type_to_uint ff_sws_pixel_type_size uses size in bytes, not bits, but ff_sws_pixel_type_to_uint assumes size in bits. ff_sws_pixel_type_to_uint is never called anywhere, so this went unnoticed. --- libswscale/ops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libswscale/ops.c b/libswscale/ops.c index 21aeb16931..2d22c4a5fa 100644 --- a/libswscale/ops.c +++ b/libswscale/ops.c @@ -99,9 +99,9 @@ SwsPixelType ff_sws_pixel_type_to_uint(SwsPixelType type) return type; switch (ff_sws_pixel_type_size(type)) { - case 8: return SWS_PIXEL_U8; - case 16: return SWS_PIXEL_U16; - case 32: return SWS_PIXEL_U32; + case 1: return SWS_PIXEL_U8; + case 2: return SWS_PIXEL_U16; + case 4: return SWS_PIXEL_U32; } av_unreachable("Invalid pixel type!"); -- 2.49.1 >>From 309b98f9330097590520a1294439f78023bbde40 Mon Sep 17 00:00:00 2001 From: cancername Date: Tue, 11 Nov 2025 05:46:18 +0100 Subject: [PATCH 2/2] swscale/ops: document that ff_sws_pixel_type_size uses bytes --- libswscale/ops.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libswscale/ops.h b/libswscale/ops.h index 8f26ee832e..069fa6a0db 100644 --- a/libswscale/ops.h +++ b/libswscale/ops.h @@ -37,6 +37,9 @@ typedef enum SwsPixelType { } SwsPixelType; const char *ff_sws_pixel_type_name(SwsPixelType type); +/** + * Return the size of type in bytes. + */ int ff_sws_pixel_type_size(SwsPixelType type) av_const; bool ff_sws_pixel_type_is_int(SwsPixelType type) av_const; SwsPixelType ff_sws_pixel_type_to_uint(SwsPixelType type) av_const; -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org