From c817c9621ee306b0360cda5191e1054e1cb70daa Mon Sep 17 00:00:00 2001 From: Fabian Giesen Date: Sun, 4 Jul 2021 16:12:32 -0700 Subject: [PATCH] stb_vorbis: Add missing cast to uint to avoid UB Fixes issue #574. --- stb_vorbis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stb_vorbis.c b/stb_vorbis.c index 38de648..a998923 100644 --- a/stb_vorbis.c +++ b/stb_vorbis.c @@ -4579,7 +4579,7 @@ static uint32 vorbis_find_page(stb_vorbis *f, uint32 *end, uint32 *last) header[i] = get8(f); if (f->eof) return 0; if (header[4] != 0) goto invalid; - goal = header[22] + (header[23] << 8) + (header[24]<<16) + (header[25]<<24); + goal = header[22] + (header[23] << 8) + (header[24]<<16) + ((uint32)header[25]<<24); for (i=22; i < 26; ++i) header[i] = 0; crc = 0;