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
2023-07-20gnu: elfutils: Skip failing tests on the Hurd....* gnu/packages/elf.scm (elfutils)[arguments]: When building natively on the Hurd, add phase 'skip-tests'. Janneke Nieuwenhuizen
2023-04-18gnu: elfutils: Skip 3 more tests on riscv64-linux....* gnu/packages/elf.scm (elfutils)[arugments]: When building for riscv64-linux skip 3 more failing tests. Efraim Flashner
2023-01-30Merge remote-tracking branch 'origin/master' into core-updates... Conflicts: doc/guix.texi gnu/local.mk gnu/packages/admin.scm gnu/packages/base.scm gnu/packages/chromium.scm gnu/packages/compression.scm gnu/packages/databases.scm gnu/packages/diffoscope.scm gnu/packages/freedesktop.scm gnu/packages/gnome.scm gnu/packages/gnupg.scm gnu/packages/guile.scm gnu/packages/inkscape.scm gnu/packages/llvm.scm gnu/packages/openldap.scm gnu/packages/pciutils.scm gnu/packages/ruby.scm gnu/packages/samba.scm gnu/packages/sqlite.scm gnu/packages/statistics.scm gnu/packages/syndication.scm gnu/packages/tex.scm gnu/packages/tls.scm gnu/packages/version-control.scm gnu/packages/xml.scm guix/build-system/copy.scm guix/scripts/home.scm Efraim Flashner
2023-01-23gnu: Add libdwarf....* gnu/packages/elf.scm (libdwarf): New variable. Pierre Neidhardt
2022-08-11Merge branch 'staging' into core-updatesMarius Bakke
2022-08-11gnu: libabigail: Remove input labels....* gnu/packages/elf.scm (libabigail)[native-inputs]: Remove labels. Marius Bakke
2022-08-11gnu: libabigail: Update to 2.0....* gnu/packages/elf.scm (libabigail): Update to 2.0. Marius Bakke