Based on (hunk for changelog removed) From b62c902dd258125cac86cd2df21fc898035a43d3 Mon Sep 17 00:00:00 2001 From: Michael Pruett Date: Mon, 29 Aug 2016 23:08:26 -0500 Subject: [PATCH] Fix undefined behavior in sign conversion. --- ChangeLog | 5 +++++ libaudiofile/modules/SimpleModule.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libaudiofile/modules/SimpleModule.h b/libaudiofile/modules/SimpleModule.h index 03c6c69..bad85ad 100644 --- a/libaudiofile/modules/SimpleModule.h +++ b/libaudiofile/modules/SimpleModule.h @@ -123,7 +123,8 @@ struct signConverter typedef typename IntTypes::UnsignedType UnsignedType; static const int kScaleBits = (Format + 1) * CHAR_BIT - 1; - static const int kMinSignedValue = -1 << kScaleBits; + static const int kMaxSignedValue = (((1 << (kScaleBits - 1)) - 1) << 1) + 1; + static const int kMinSignedValue = -kMaxSignedValue - 1; struct signedToUnsigned : public std::unary_function { ref='/guix/'>summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2021-07-29gnu: php: Update to 7.4.22 [security fixes]....* gnu/packages/php.scm (php): Update to 7.4.22. Tobias Geerinckx-Rice
2021-07-23gnu: php: Update to 7.4.21....* gnu/packages/php.scm (php): Update to 7.4.21. [arguments]: Remove trailing #t's. [native-inputs]: Remove INTLTOOL. Add GETTEXT-MINIMAL. Marius Bakke
2021-06-26gnu: php: Build sodium....* gnu/packages/php.scm (php): Build sodium extension. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Aljosha Papsch