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 { summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2017-01-04gnu: calibre: Update to 2.76.0....* gnu/packages/ebook.scm (calibre): Update to 2.76.0. Signed-off-by: Leo Famulari <leo@famulari.name> Alex Griffin
2016-12-12gnu: calibre: Update to 2.74.0....* gnu/packages/ebook.scm (calibre): Update to 2.74.0. Efraim Flashner
2016-12-12gnu: calibre: Update qt dependancies....* gnu/packages/ebook.scm (calibre)[native-inputs]: Remove qt, add qtbase. [inputs]: Remove qt, replace python2-pyqt@5.5 with python2-pyqt. Efraim Flashner
2016-12-02gnu: calibre: Do not use python setuptools for building....* gnu/packages/ebook.scm (calibre)[arguments]: Set #:use-setuptools? to false. Hartmut Goebel