From 9367ef1ed6b78d6bc078620009e383b3deae60b2 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Wed, 4 Jan 2023 21:52:59 -0500 Subject: [BugFix] Fix some Shif related UB -- ASAN these are the low hanging fruit identified by ASAN cast the byte values before shift Change-Id: Ifc5645354a10c15ccd09d1343e1705857a51e011 --- firmware/export/pcm_sampr.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'firmware') diff --git a/firmware/export/pcm_sampr.h b/firmware/export/pcm_sampr.h index 70f2dc2ba2..fc48a943fd 100644 --- a/firmware/export/pcm_sampr.h +++ b/firmware/export/pcm_sampr.h @@ -427,10 +427,10 @@ extern const unsigned long rec_freq_sampr[REC_NUM_FREQ]; #ifdef CONFIG_SAMPR_TYPES -#define SAMPR_TYPE_MASK (0xff << 24) -#define SAMPR_TYPE_PLAY (0x00 << 24) +#define SAMPR_TYPE_MASK (0xffu << 24) +#define SAMPR_TYPE_PLAY (0x00u << 24) #ifdef HAVE_RECORDING -#define SAMPR_TYPE_REC (0x01 << 24) +#define SAMPR_TYPE_REC (0x01u << 24) #endif #ifndef PCM_SAMPR_CONFIG_ONLY -- cgit v1.2.3