diff png.c @ 2346:0111c8344477

Fix some issues identified by asan/ubsan
author Michael Pavone <pavone@retrodev.com>
date Sat, 07 Oct 2023 18:04:35 -0700
parents eb45ad9d8a3f
children da2e06c42d16
line wrap: on
line diff
--- a/png.c	Fri Oct 06 00:20:37 2023 -0700
+++ b/png.c	Sat Oct 07 18:04:35 2023 -0700
@@ -337,7 +337,7 @@
 	if (*last) {
 		(*last)++;
 	}
-	return alpha << 24 | red << 16 | green << 8 | blue;
+	return ((uint32_t)alpha) << 24 | red << 16 | green << 8 | blue;
 }
 
 static filter_fun filters[] = {filter_none, filter_sub, filter_up, filter_avg, filter_paeth};