diff options
Diffstat (limited to 'lib/rbcodec/codecs/libopus')
-rw-r--r-- | lib/rbcodec/codecs/libopus/ogg/framing.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rbcodec/codecs/libopus/ogg/framing.c b/lib/rbcodec/codecs/libopus/ogg/framing.c index a7032a6a35..eb32351590 100644 --- a/lib/rbcodec/codecs/libopus/ogg/framing.c +++ b/lib/rbcodec/codecs/libopus/ogg/framing.c | |||
@@ -235,8 +235,9 @@ static int _os_lacing_expand(ogg_stream_state *os,long needed){ | |||
235 | perform the checksum simultaneously with other copies */ | 235 | perform the checksum simultaneously with other copies */ |
236 | 236 | ||
237 | static ogg_uint32_t _os_update_crc(ogg_uint32_t crc, unsigned char *buffer, int size){ | 237 | static ogg_uint32_t _os_update_crc(ogg_uint32_t crc, unsigned char *buffer, int size){ |
238 | #define u32(v) (uint32_t)v | ||
238 | while (size>=8){ | 239 | while (size>=8){ |
239 | crc^=buffer[0]<<24|buffer[1]<<16|buffer[2]<<8|buffer[3]; | 240 | crc^=((u32(buffer[0]))<<24)|((u32(buffer[1]))<<16)|((u32(buffer[2]))<<8)|(u32(buffer[3])); |
240 | 241 | ||
241 | crc=crc_lookup[7][ crc>>24 ]^crc_lookup[6][(crc>>16)&0xFF]^ | 242 | crc=crc_lookup[7][ crc>>24 ]^crc_lookup[6][(crc>>16)&0xFF]^ |
242 | crc_lookup[5][(crc>> 8)&0xFF]^crc_lookup[4][ crc &0xFF]^ | 243 | crc_lookup[5][(crc>> 8)&0xFF]^crc_lookup[4][ crc &0xFF]^ |
@@ -246,7 +247,7 @@ static ogg_uint32_t _os_update_crc(ogg_uint32_t crc, unsigned char *buffer, int | |||
246 | buffer+=8; | 247 | buffer+=8; |
247 | size-=8; | 248 | size-=8; |
248 | } | 249 | } |
249 | 250 | #undef u32 | |
250 | while (size--) | 251 | while (size--) |
251 | crc=(crc<<8)^crc_lookup[0][((crc >> 24)&0xff)^*buffer++]; | 252 | crc=(crc<<8)^crc_lookup[0][((crc >> 24)&0xff)^*buffer++]; |
252 | return crc; | 253 | return crc; |