diff options
| author | hathach <[email protected]> | 2025-12-12 21:38:48 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2025-12-12 21:38:48 +0700 |
| commit | bb1495966d189dc2fb001bc9f3b7908a02a971bb (patch) | |
| tree | 63c5044798267aa414a1073f3f7c3976cae65797 /src/common/tusb_common.h | |
| parent | 686e975e4737e668577a66213910841036422752 (diff) | |
| parent | 02da4e81c77fd7e77ff0b92c616519358c6db4ee (diff) | |
Merge branch 'refs/heads/master' into audio_open
Diffstat (limited to 'src/common/tusb_common.h')
| -rw-r--r-- | src/common/tusb_common.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h index b53fa5c02..d74760608 100644 --- a/src/common/tusb_common.h +++ b/src/common/tusb_common.h @@ -388,10 +388,7 @@ TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_desc_subtype(void const* desc) { } TU_ATTR_ALWAYS_INLINE static inline bool tu_desc_in_bounds(const uint8_t *p_desc, const uint8_t *desc_end) { - if (p_desc >= desc_end) { - return false; - } - return tu_desc_next(p_desc) <= desc_end; + return p_desc < desc_end && tu_desc_next(p_desc) <= desc_end; } // find descriptor that match byte1 (type) |
