Fixed BehaviorSanitizer warnings.

This commit is contained in:
akallabeth 2020-05-15 11:20:24 +02:00
parent 0502bfcfbc
commit a887c890f2
1 changed files with 2 additions and 1 deletions

View File

@ -327,7 +327,8 @@ static void string_set(char** out, const char* in)
static unsigned lodepng_read32bitInt(const unsigned char* buffer)
{
return (unsigned)((buffer[0] << 24) | (buffer[1] << 16) | (buffer[2] << 8) | buffer[3]);
return (unsigned)(((unsigned)buffer[0] << 24) | ((unsigned)buffer[1] << 16) |
((unsigned)buffer[2] << 8) | buffer[3]);
}
#if defined(LODEPNG_COMPILE_PNG) || defined(LODEPNG_COMPILE_ENCODER)