From 18f09c8e7656dcd847ad66f2816aaa4aa06d7a09 Mon Sep 17 00:00:00 2001 From: harry Date: Thu, 9 Feb 2023 20:06:18 -0500 Subject: [PATCH] Fix for UBSAN left shift of negative number error in SexyFilter2 --- src/filter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filter.cpp b/src/filter.cpp index d1e13ac6..650f8c43 100644 --- a/src/filter.cpp +++ b/src/filter.cpp @@ -37,7 +37,7 @@ void SexyFilter2(int32 *in, int32 count) while(count--) { int64 dropcurrent; - dropcurrent=((*in<<16)-acc)>>3; + dropcurrent=( int32(uint32(*in)<<16)-acc)>>3; acc+=dropcurrent; *in=acc>>16;