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 26DD84E68D for ; Mon, 26 Jan 2026 16:19:47 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'my/H+KKtiii6PrjUmS7B82EfD9N2vjst9C2z7dZX0W4=', expected b'wb9uwXiv49UgvwD6LcNyrjyD2K80gx+VIwK45FB+4S8=')) 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=1769444374; 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=my/H+KKtiii6PrjUmS7B82EfD9N2vjst9C2z7dZX0W4=; b=zGIxISQMtN5PQXjNJ+LQlVsqjJPKqD+Wspzt0aNlljk6ohMTlV1CVTvykA9wHMu2gwjso PLeN6+fgBF2fqe85dyLbrTniq60SjL9grNJ8rvIksTtcqXl2hWFchq0fvcS9Kd6JM6VjpHf d73qiivAirgdwbR2Yc1md8ziHcjYbCrGBJb2CGoo9ZKKBlJPH51OZsQ05xNke/f2Vh8Mv+x HaOFBXhlA50Xc0kcnaLw3AP2v5G7Eu+Ip6zIyg8XHwCWNDlWZpxprwqPhfY1NUetpKdoW0b YeXxgUu71KjNhSyEngo17mOjRyWjIkQ5Mc/fYZpQC4cA2PhHFrhmbCOp51aA== Received: from [172.20.0.4] (unknown [172.20.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 4C8B4690EDE; Mon, 26 Jan 2026 18:19:34 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1769444359; b=Las0QVDhcDVc/7CZ4TgMWMLM+EeBp1nd9hs6J2GlXTxUKu9zpSuJp7kQrcQMJaqwOxxO2 FFbIyC0AaiPWFUR4XwgsfW1hhpfIR670ho8lwNhfkCi4VcalN/R7uypKlqD7b9dyJ/HDzIE 3Pa3ITK6j4lRj//qX0/HUOCguhRannMboVE9xbxF981wQjkzquz86Oeo4uqmuCELyPZ4xkU CxjC34vsRRoUFiqnTbKRaaxvKY1Gmjq1RTpapZv915Y5ams/ieLlMpl31spN/Q/KNiYlNWk Th/ygwtO0oGOC0uvy3ddw4r6CWnpjJF1Qy9AHRhzMBCHChYp8CNkX+0MIYSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1769444359; 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=N/VCUp9aBZwZLHz6lZxm2r2mRtQ09khCaWnr2Z7l1RI=; b=f78Tuz2c9V8O7qmzxrDI8JOC3s3nutOkZkn7BKJ8CgC9HwgdtFGKWeo3UXsqStYdOld/4 Ee25UkN1aO+K+5omMUCUtz4I/3xgY8NUFyUQ+Vx/2ew+tn2M2LCcsoriE9FWb4NpLO//1LG YK/6VQyJGG9Cu5kIAH9dPNxeb+1CAwLho+KlziMaj9XZ3cAffjToVqIdQ2PzLkQ4tKzPXep r73Y5c7bNsoI9cMho5C7Sc3iMXNizoyW4z404jjDDSr3viwC/SqVaBFzqWIkKiEOpgU1NJ1 MF0XPDB2Ki/73LKGyAcXJR13fMakAK3Frr2ud7bHqk7Am+CIkzDc4C17DNkw== 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=1769444352; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=wb9uwXiv49UgvwD6LcNyrjyD2K80gx+VIwK45FB+4S8=; b=PkROj2qJGeZTTLRNw7JRqN2nOoW0TPjJlRS+SY8Q/HWQjPKIicC7cdDTxKO5kU8NLFDuJ sA2ehSOuskT0ZF9bAKg0Imu4MczKOZLG0pWQxwnAKmX+fNEr/o3Lt3UUMhQy3m7sjA8Vzuy elUmk/AP2WYMM9WjtAhYo+sJr2avEZqVM4i0ImSNXyBlWsMBMr6o5qayWukkYxMHukFRJBp S46z+mrCxpcH6XYUc+Jo7khwHYxpoKkM6qRCUmkSIgU/1ECpPAVTIVLzWLDANkrHLhv3c// 2lMo4mJbW54BYFJCVJVWnYbcfjbVSz5+t1UIG4lnIz70AlH+NviGgxynDtIQ== Received: from 69dab402ede7 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 163BF690E36 for ; Mon, 26 Jan 2026 18:19:12 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Mon, 26 Jan 2026 16:19:11 -0000 Message-ID: <176944435219.25.18240044177759007937@4457048688e7> Message-ID-Hash: KQASWU5IAJO4255HB3GGWL4LFAII6MNR X-Message-ID-Hash: KQASWU5IAJO4255HB3GGWL4LFAII6MNR 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] [PR] swscale/swscale: force SwsDither and SwsAlphaBlend to 32 bits (PR #21594) 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: Zhao Zhili via ffmpeg-devel Cc: Zhao Zhili Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #21594 opened by Zhao Zhili (quink) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21594 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21594.patch The 'sws_dither' and 'alphablend' options access 'SwsDither' and 'SwsAlphaBlend' enum fields as integers. This is unsafe when the code is compiled with -fshort-enums, as the enum size might be smaller than an int. Since the 'dither' and 'alpha_blend' struct members are part of the public API, their types cannot be easily changed. To ensure safe integer access and maintain ABI compatibility across different compiler settings, a MAX_ENUM value is added to force the enums to a 32-bit underlying type. >>From aa03934bcaf51b3d4e6ff5da1abf64c4cd14a885 Mon Sep 17 00:00:00 2001 From: Zhao Zhili Date: Mon, 26 Jan 2026 23:50:50 +0800 Subject: [PATCH] swscale/swscale: force SwsDither and SwsAlphaBlend to 32 bits The 'sws_dither' and 'alphablend' options access 'SwsDither' and 'SwsAlphaBlend' enum fields as integers. This is unsafe when the code is compiled with -fshort-enums, as the enum size might be smaller than an int. Since the 'dither' and 'alpha_blend' struct members are part of the public API, their types cannot be easily changed. To ensure safe integer access and maintain ABI compatibility across different compiler settings, a MAX_ENUM value is added to force the enums to a 32-bit underlying type. --- libswscale/swscale.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libswscale/swscale.h b/libswscale/swscale.h index 345e5458ce..495d500f14 100644 --- a/libswscale/swscale.h +++ b/libswscale/swscale.h @@ -82,6 +82,7 @@ typedef enum SwsDither { SWS_DITHER_A_DITHER, /* arithmetic addition */ SWS_DITHER_X_DITHER, /* arithmetic xor */ SWS_DITHER_NB, /* not part of the ABI */ + SWS_DITHER_MAX_ENUM = 0x7FFFFFFF, /* force size to 32 bits, not a valid dither type */ } SwsDither; typedef enum SwsAlphaBlend { @@ -89,6 +90,7 @@ typedef enum SwsAlphaBlend { SWS_ALPHA_BLEND_UNIFORM, SWS_ALPHA_BLEND_CHECKERBOARD, SWS_ALPHA_BLEND_NB, /* not part of the ABI */ + SWS_ALPHA_BLEND_MAX_ENUM = 0x7FFFFFFF, /* force size to 32 bits, not a valid blend mode */ } SwsAlphaBlend; typedef enum SwsFlags { -- 2.52.0 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org