Skip to content

Commit

Permalink
libavutil/ppc: defines involving bit shifts should be unsigned
Browse files Browse the repository at this point in the history
Otherwise, these can overflow at the boundaries of the integer type.

Signed-off-by: Brad Smith <[email protected]>
(cherry picked from commit c325f9c)
Signed-off-by: Brad Smith <[email protected]>
  • Loading branch information
SeanMcG authored and brad0 committed Nov 27, 2024
1 parent ac4c725 commit 0c641ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libavutil/ppc/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
#define AT_HWCAP2 26
#endif

#define HWCAP_PPC_VSX (1 << 7)
#define HWCAP_PPC_ALTIVEC (1 << 28)
#define HWCAP2_PPC_ARCH_2_07 (1 << 31)
#define HWCAP_PPC_VSX (1U << 7)
#define HWCAP_PPC_ALTIVEC (1U << 28)
#define HWCAP2_PPC_ARCH_2_07 (1U << 31)

/**
* This function MAY rely on signal() or fork() in order to make sure AltiVec
Expand Down

0 comments on commit 0c641ee

Please sign in to comment.