From a4d2feea0b57944b70dc09fc1e87c3e80192e2be Mon Sep 17 00:00:00 2001 From: Michael Schwendt Date: Thu, 4 Feb 2016 10:16:55 +0100 Subject: [PATCH] avoid int overflow too --- audiofile-0.3.6-left-shift-neg.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/audiofile-0.3.6-left-shift-neg.patch b/audiofile-0.3.6-left-shift-neg.patch index 6699969..deef23c 100644 --- a/audiofile-0.3.6-left-shift-neg.patch +++ b/audiofile-0.3.6-left-shift-neg.patch @@ -6,7 +6,7 @@ diff -Nurb --strip-trailing-cr audiofile-0.3.6-orig/libaudiofile/modules/SimpleM static const int kScaleBits = (Format + 1) * CHAR_BIT - 1; - static const int kMinSignedValue = -1 << kScaleBits; -+ static const int kMinSignedValue = 0L-(1< { @@ -18,7 +18,7 @@ diff -Nurb --strip-trailing-cr audiofile-0.3.6-orig/test/FloatToInt.cpp audiofil } -static const int32_t kMinInt24 = -1<<23; -+static const int32_t kMinInt24 = 0L-(1<<23); ++static const int32_t kMinInt24 = 0-(1U<<23); static const int32_t kMaxInt24 = (1<<23) - 1; TEST_F(FloatToIntTest, Int24) @@ -30,7 +30,7 @@ diff -Nurb --strip-trailing-cr audiofile-0.3.6-orig/test/IntToFloat.cpp audiofil } -static const int32_t kMinInt24 = -1<<23; -+static const int32_t kMinInt24 = 0L-(1<<23); ++static const int32_t kMinInt24 = 0-(1U<<23); static const int32_t kMaxInt24 = (1<<23) - 1; TEST_F(IntToFloatTest, Int24) @@ -42,7 +42,7 @@ diff -Nurb --strip-trailing-cr audiofile-0.3.6-orig/test/Sign.cpp audiofile-0.3. } -static const int32_t kMinInt24 = -1<<23; -+static const int32_t kMinInt24 = 0L-(1<<23); ++static const int32_t kMinInt24 = 0-(1U<<23); static const int32_t kMaxInt24 = (1<<23) - 1; static const uint32_t kMaxUInt24 = (1<<24) - 1;