diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2025-03-18 15:48:03 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2025-03-21 04:30:09 +0100 |
commit | dff498fddfaee28c825af324d4444aa2ec8ce6a9 (patch) | |
tree | 88d8944be299eda48ffbeeb0cbc7a1772ce98869 /tests/api/api-seek-test.c | |
parent | 0ce405afb8df221b3a975a30b5c229449c8ed7da (diff) | |
download | ffmpeg-dff498fddfaee28c825af324d4444aa2ec8ce6a9.tar.gz |
avutil/csp: Improve enum range comparisons
The underlying integer type of an enumeration is
implementation-defined (see C11, 6.7.2.2 (4)); GCC defaults
to unsigned if there are no negative values like for all enums
from pixfmt.h except enum AVPixelFormat.
This means that tests like "if (csp >= AVCOL_SPC_NB)" for
invalid colorspaces need not work as expected (namely if
enum AVColorSpace is signed). It also means that testing
for such an enum variable to be >= 0 may be tautologically
true. Clang emits a -Wtautological-unsigned-enum-zero-compare
warning for this.
Fix both of these issues by casting to unsigned.
Also do the same in libswscale/format.c.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'tests/api/api-seek-test.c')
0 files changed, 0 insertions, 0 deletions