After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 777921 - audio-resampler: integer overflow in clamping code
audio-resampler: integer overflow in clamping code
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.x
Other Linux
: Normal normal
: 1.10.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-30 09:11 UTC by Nicola
Modified: 2017-01-30 10:37 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Nicola 2017-01-30 09:11:55 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
Comment 1 Sebastian Dröge (slomo) 2017-01-30 10:36:43 UTC
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