This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new 9ebfd68096 swscale/swscale: force SwsDither and SwsAlphaBlend to 32
bits
9ebfd68096 is described below
commit 9ebfd6809699b504a80eabb77bf46afbb996a45d
Author: Zhao Zhili <[email protected]>
AuthorDate: Mon Jan 26 23:50:50 2026 +0800
Commit: Zhao Zhili <[email protected]>
CommitDate: Wed Feb 4 04:00:53 2026 +0000
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 {
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]