picture.c: Fix signed shift undefined behavior

Fix ubsan report:
src/picture.c:136:17: runtime error: left shift of 255 by 24 places
cannot be represented in type 'int'
parent 6e0a98cc
......@@ -119,7 +119,7 @@ static int is_gif(const unsigned char *buf, size_t length){
}
#define READ_U32_BE(buf) \
(((buf)[0]<<24)|((buf)[1]<<16)|((buf)[2]<<8)|((buf)[3]&0xff))
(((opus_uint32)(buf)[0]<<24)|((buf)[1]<<16)|((buf)[2]<<8)|(buf)[3])
/*Tries to extract the width, height, bits per pixel, and palette size of a
PNG.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment