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 644845 - [alsa] Comparison of unsigned int < 0 always false in gstalsamixer.c
[alsa] Comparison of unsigned int < 0 always false in gstalsamixer.c
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.32
Other Linux
: Normal minor
: 0.10.33
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-15 17:36 UTC by Blaise Gassend
Modified: 2011-03-15 18:49 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Blaise Gassend 2011-03-15 17:36:11 UTC
rnfds is a guint, so in the following code from gstalsamixer.c, the error condition will never get triggered.

{{{
  rnfds = snd_mixer_poll_descriptors (mixer->handle, pfds, nfds);
  g_assert (rnfds <= nfds);

  if (rnfds < 0) {
    GST_ELEMENT_ERROR (mixer, RESOURCE, READ, (NULL), ("alsa error: %s",
            snd_strerror (rnfds)));
}}}
Comment 1 Sebastian Dröge (slomo) 2011-03-15 18:48:53 UTC
commit 185a8ddcaa0caff36e5eb801a3347e1c849061df
Author: Blaise Gassend <blaise@suitabletech.com>
Date:   Tue Mar 15 19:47:11 2011 +0100

    alsamixer: Store return values of poll functions in a signed integer
    
    Negative return values are used for errors and storing
    them in an unsigned integer will make it impossible to
    detect the errors.
    
    Fixes bug #644845.