Skip to content
Snippets Groups Projects
Commit e751823f authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Jean-Baptiste Kempf
Browse files

bitstream: swab: Fix potentially undefined shifts

parent d7e8d6ac
No related branches found
No related tags found
1 merge request!3Fix invalid read
Pipeline #15038 passed with stage
in 59 seconds
......@@ -30,8 +30,10 @@
#else
# define swab32(x)\
((((uint8_t*)&x)[0] << 24) | (((uint8_t*)&x)[1] << 16) | \
(((uint8_t*)&x)[2] << 8) | (((uint8_t*)&x)[3]))
(((uint32_t)(((uint8_t*)&x)[0]) << 24u) | \
((uint32_t)(((uint8_t*)&x)[1]) << 16u) | \
((uint32_t)(((uint8_t*)&x)[2]) << 8u) | \
((uint32_t)(((uint8_t*)&x)[3])))
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment