From de98732b04960f5d7897327ff58c3368177971e2 Mon Sep 17 00:00:00 2001 From: Pascal Massimino Date: Fri, 6 Jul 2018 21:25:41 -0700 Subject: [PATCH] fix GetColorf() bug We should only use the lower 8 bits, masking was missing. Change-Id: I3072168e100b242356ad57b5a73b7f4d6ebfbb9e --- examples/vwebp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/vwebp.c b/examples/vwebp.c index a79c72cb..f3f16474 100644 --- a/examples/vwebp.c +++ b/examples/vwebp.c @@ -286,7 +286,7 @@ static void PrintString(const char* const text) { } static float GetColorf(uint32_t color, int shift) { - return (color >> shift) / 255.f; + return ((color >> shift) & 0xff) / 255.f; } static void DrawCheckerBoard(void) {