[SCM] Audacity debian packaging branch, master, updated. debian/1.3.12-2-14-g3dfd3f8

bdrung-guest at users.alioth.debian.org bdrung-guest at users.alioth.debian.org
Tue Jun 29 23:50:54 UTC 2010


The following commit has been merged in the master branch:
commit 2dadae0527326d462c3da122a51886617bda0229
Author: Benjamin Drung <bdrung at gmail.com>
Date:   Wed Jun 30 00:58:09 2010 +0200

    Add open-mixer.patch to fix segfault with multiple ALSA devices.
    
    Closes: #584605
    Thanks: Dave Witbrodt <dawitbro at sbcglobal.net>

diff --git a/debian/patches/open-mixer.patch b/debian/patches/open-mixer.patch
new file mode 100644
index 0000000..4bc8fca
--- /dev/null
+++ b/debian/patches/open-mixer.patch
@@ -0,0 +1,38 @@
+Description: Fix segfault with multiple ALSA devices
+Bug-Debian: http://bugs.debian.org/584605
+Bug: http://bugzilla.audacityteam.org/show_bug.cgi?id=174
+Author: Dave Witbrodt <dawitbro at sbcglobal.net>
+
+--- a/lib-src/portmixer/src/px_linux_alsa.c
++++ b/lib-src/portmixer/src/px_linux_alsa.c
+@@ -136,7 +136,10 @@
+                dev->numselems++;
+             }
+             else if (snd_mixer_selem_is_enum_capture(elem)) {
+-               dev->numselems += snd_mixer_selem_get_enum_items(elem);
++               int retval = snd_mixer_selem_get_enum_items(elem);
++
++               if (retval > 0)
++                  dev->numselems += retval;
+             }
+          }
+       }
+@@ -196,12 +199,15 @@
+             i++;
+          }
+          else if (snd_mixer_selem_is_enum_capture(elem)) {
+-            unsigned int cnt = snd_mixer_selem_get_enum_items(elem);
+-            unsigned int j;
++            int j;
++            int cnt = snd_mixer_selem_get_enum_items(elem);
++
++            if (cnt < 0)
++               continue;
+ 
+             for (j = 0; j < cnt; j++) {
+                char iname[256];
+-               snd_mixer_selem_get_enum_item_name(elem, j, sizeof(iname), iname);
++               snd_mixer_selem_get_enum_item_name(elem, (unsigned int) j, sizeof(iname), iname);
+                snprintf(name,
+                         sizeof(name),
+                         "%s:%d",
diff --git a/debian/patches/series b/debian/patches/series
index eeee20b..11c648b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 enable-experimental-linking.patch
 fix-slider-background-color.patch
+open-mixer.patch
diff --git a/lib-src/portmixer/src/px_linux_alsa.c b/lib-src/portmixer/src/px_linux_alsa.c
index 2b4e70f..c762bd0 100644
--- a/lib-src/portmixer/src/px_linux_alsa.c
+++ b/lib-src/portmixer/src/px_linux_alsa.c
@@ -136,7 +136,10 @@ static int open_mixer(PxDev *dev, int card, int playback)
                dev->numselems++;
             }
             else if (snd_mixer_selem_is_enum_capture(elem)) {
-               dev->numselems += snd_mixer_selem_get_enum_items(elem);
+               int retval = snd_mixer_selem_get_enum_items(elem);
+
+               if (retval > 0)
+                  dev->numselems += retval;
             }
          }
       }
@@ -196,12 +199,15 @@ static int open_mixer(PxDev *dev, int card, int playback)
             i++;
          }
          else if (snd_mixer_selem_is_enum_capture(elem)) {
-            unsigned int cnt = snd_mixer_selem_get_enum_items(elem);
-            unsigned int j;
+            int j;
+            int cnt = snd_mixer_selem_get_enum_items(elem);
+
+            if (cnt < 0)
+               continue;
 
             for (j = 0; j < cnt; j++) {
                char iname[256];
-               snd_mixer_selem_get_enum_item_name(elem, j, sizeof(iname), iname);
+               snd_mixer_selem_get_enum_item_name(elem, (unsigned int) j, sizeof(iname), iname);
                snprintf(name,
                         sizeof(name),
                         "%s:%d",

-- 
Audacity debian packaging



More information about the pkg-multimedia-commits mailing list