mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-08-10 17:14:41 +00:00
swscale/ops: fix merge_comp_flags() for SWS_COMP_SWAPPED
This violates the documentation (monoid property). It's a bit arbitrary whether to consider this an OR-type or AND-type flag, since mixing swapped and non-swapped components is almost surely a bug, but keeping it as an OR-type makes sure such cases at least show up in the result. Sponsored-by: Sovereign Tech Fund Signed-off-by: Niklas Haas <git@haasn.dev>
This commit is contained in:
@@ -281,7 +281,7 @@ enum {
|
||||
/* merge_comp_flags() forms a monoid with SWS_COMP_IDENTITY as the null element */
|
||||
static SwsCompFlags merge_comp_flags(SwsCompFlags a, SwsCompFlags b)
|
||||
{
|
||||
const SwsCompFlags flags_or = SWS_COMP_GARBAGE;
|
||||
const SwsCompFlags flags_or = SWS_COMP_GARBAGE | SWS_COMP_SWAPPED;
|
||||
const SwsCompFlags flags_and = SWS_COMP_IDENTITY;
|
||||
return ((a & b) & flags_and) | ((a | b) & flags_or);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user