GNOME Bugzilla – Bug 777921
audio-resampler: integer overflow in clamping code
Last modified: 2017-01-30 10:37:01 UTC
cross compiling git master from linux for windows x86_64 gives this error CC libaudio_resampler_sse41_la-audio-resampler-x86-sse41.lo ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.c: In function ‘inner_product_gint32_full_1_sse41’: ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.c:73:3: error: integer overflow in expression [-Werror=overflow] *o = CLAMP (res, -(1L << 31), (1L << 31) - 1); ^ In file included from /usr/x86_64-w64-mingw32/lib/glib-2.0/include/glibconfig.h:9:0, from /usr/x86_64-w64-mingw32/include/glib-2.0/glib/gtypes.h:32, from /usr/x86_64-w64-mingw32/include/glib-2.0/glib/galloca.h:32, from /usr/x86_64-w64-mingw32/include/glib-2.0/glib.h:30, from /usr/x86_64-w64-mingw32/include/gstreamer-1.0/gst/gst.h:27, from ../../../../gst-libs/gst/audio/audio-resampler.h:23, from ../../../../gst-libs/gst/audio/audio-resampler-private.h:23, from ../../../../gst-libs/gst/audio/audio-resampler-macros.h:25, from ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.h:23, from ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.c:24: ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.c:73:20: error: integer overflow in expression [-Werror=overflow] *o = CLAMP (res, -(1L << 31), (1L << 31) - 1); ^ /usr/x86_64-w64-mingw32/include/glib-2.0/glib/gmacros.h:297:66: note: in definition of macro ‘CLAMP’ #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) ^~~ ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.c:73:20: error: integer overflow in expression [-Werror=overflow] *o = CLAMP (res, -(1L << 31), (1L << 31) - 1); ^ /usr/x86_64-w64-mingw32/include/glib-2.0/glib/gmacros.h:297:75: note: in definition of macro ‘CLAMP’ #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) ^~~ ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.c:73:3: error: integer overflow in expression [-Werror=overflow] *o = CLAMP (res, -(1L << 31), (1L << 31) - 1); ^ ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.c: In function ‘inner_product_gint32_linear_1_sse41’: ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.c:116:3: error: integer overflow in expression [-Werror=overflow] *o = CLAMP (res, -(1L << 31), (1L << 31) - 1); ^ In file included from /usr/x86_64-w64-mingw32/lib/glib-2.0/include/glibconfig.h:9:0, from /usr/x86_64-w64-mingw32/include/glib-2.0/glib/gtypes.h:32, from /usr/x86_64-w64-mingw32/include/glib-2.0/glib/galloca.h:32, from /usr/x86_64-w64-mingw32/include/glib-2.0/glib.h:30, from /usr/x86_64-w64-mingw32/include/gstreamer-1.0/gst/gst.h:27, from ../../../../gst-libs/gst/audio/audio-resampler.h:23, from ../../../../gst-libs/gst/audio/audio-resampler-private.h:23, from ../../../../gst-libs/gst/audio/audio-resampler-macros.h:25, from ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.h:23, from ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.c:24: ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.c:116:20: error: integer overflow in expression [-Werror=overflow] *o = CLAMP (res, -(1L << 31), (1L << 31) - 1); ^ /usr/x86_64-w64-mingw32/include/glib-2.0/glib/gmacros.h:297:66: note: in definition of macro ‘CLAMP’ #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) ^~~ ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.c:116:20: error: integer overflow in expression [-Werror=overflow] *o = CLAMP (res, -(1L << 31), (1L << 31) - 1); ^ /usr/x86_64-w64-mingw32/include/glib-2.0/glib/gmacros.h:297:75: note: in definition of macro ‘CLAMP’ #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) ^~~ ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.c:116:3: error: integer overflow in expression [-Werror=overflow] *o = CLAMP (res, -(1L << 31), (1L << 31) - 1); ^ ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.c: In function ‘inner_product_gint32_cubic_1_sse41’: ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.c:181:3: error: integer overflow in expression [-Werror=overflow] *o = CLAMP (res, -(1L << 31), (1L << 31) - 1); ^ In file included from /usr/x86_64-w64-mingw32/lib/glib-2.0/include/glibconfig.h:9:0, from /usr/x86_64-w64-mingw32/include/glib-2.0/glib/gtypes.h:32, from /usr/x86_64-w64-mingw32/include/glib-2.0/glib/galloca.h:32, from /usr/x86_64-w64-mingw32/include/glib-2.0/glib.h:30, from /usr/x86_64-w64-mingw32/include/gstreamer-1.0/gst/gst.h:27, from ../../../../gst-libs/gst/audio/audio-resampler.h:23, from ../../../../gst-libs/gst/audio/audio-resampler-private.h:23, from ../../../../gst-libs/gst/audio/audio-resampler-macros.h:25, from ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.h:23, from ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.c:24: ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.c:181:20: error: integer overflow in expression [-Werror=overflow] *o = CLAMP (res, -(1L << 31), (1L << 31) - 1); ^ /usr/x86_64-w64-mingw32/include/glib-2.0/glib/gmacros.h:297:66: note: in definition of macro ‘CLAMP’ #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) ^~~ ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.c:181:20: error: integer overflow in expression [-Werror=overflow] *o = CLAMP (res, -(1L << 31), (1L << 31) - 1); ^ /usr/x86_64-w64-mingw32/include/glib-2.0/glib/gmacros.h:297:75: note: in definition of macro ‘CLAMP’ #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) ^~~ ../../../../gst-libs/gst/audio/audio-resampler-x86-sse41.c:181:3: error: integer overflow in expression [-Werror=overflow] *o = CLAMP (res, -(1L << 31), (1L << 31) - 1); there is no error with 1.10 or compiling git master for windows x86
commit f939f05304e447f2279adc7d55818d85157a879d Author: Sebastian Dröge <sebastian@centricular.com> Date: Mon Jan 30 12:35:04 2017 +0200 audio-resampler: Fix integer overflow in clamping code https://bugzilla.gnome.org/show_bug.cgi?id=777921