[SCM] Audacity debian packaging branch, master, updated. debian/1.3.7-3-58-gda713cc
diwic-guest at users.alioth.debian.org
diwic-guest at users.alioth.debian.org
Thu Nov 12 20:59:46 UTC 2009
The following commit has been merged in the master branch:
commit da713cc8ef23148017b9df46c4b89ffc28b6ea3f
Author: David Henningsson <audacity at epost.diwic.se>
Date: Thu Nov 12 21:42:17 2009 +0100
Avoid crash in GetDefaultPlayDevice (LP: #475277)
diff --git a/debian/patches/crash-on-get-default-device.patch b/debian/patches/crash-on-get-default-device.patch
new file mode 100644
index 0000000..b81b069
--- /dev/null
+++ b/debian/patches/crash-on-get-default-device.patch
@@ -0,0 +1,44 @@
+diff -Nur -x '*.orig' -x '*~' audacity/src/prefs/DevicePrefs.cpp audacity.new/src/prefs/DevicePrefs.cpp
+--- audacity/src/prefs/DevicePrefs.cpp 2009-11-12 21:31:24.097328400 +0100
++++ audacity.new/src/prefs/DevicePrefs.cpp 2009-11-12 21:32:06.944830051 +0100
+@@ -204,10 +204,12 @@
+ if (mPlay->GetCount() == 0) {
+ playnames.Add(_("No devices found"));
+ mPlay->Append(playnames[0], (void *) NULL);
++ mPlay->SetSelection(0);
+ }
+ if (mRecord->GetCount() == 0) {
+ recordnames.Add(_("No devices found"));
+ mRecord->Append(recordnames[0], (void *) NULL);
++ mRecord->SetSelection(0);
+ }
+
+ /* what if we have no device selected? we should choose the default on
+@@ -296,8 +298,11 @@
+
+ wxString DevicePrefs::GetDefaultPlayDevice(int index)
+ {
+- const struct PaHostApiInfo *apiinfo = Pa_GetHostApiInfo(index);
+- // get info on API
++ if (index < 0 || index >= Pa_GetHostApiCount()) {
++ return wxEmptyString;
++ }
++
++ const struct PaHostApiInfo *apiinfo = Pa_GetHostApiInfo(index); // get info on API
+ wxLogDebug(wxT("GetDefaultPlayDevice(): HostAPI index %d, name %s"), index, wxString(apiinfo->name, wxConvLocal).c_str());
+ wxLogDebug(wxT("GetDefaultPlayDevice() default output %d"), apiinfo->defaultOutputDevice);
+ const PaDeviceInfo* devinfo = Pa_GetDeviceInfo(apiinfo->defaultOutputDevice);
+@@ -308,8 +313,11 @@
+
+ wxString DevicePrefs::GetDefaultRecordDevice(int index)
+ {
+- const struct PaHostApiInfo *apiinfo; /* info on this API */
+- apiinfo = Pa_GetHostApiInfo(index); // get info on API
++ if (index < 0 || index >= Pa_GetHostApiCount()) {
++ return wxEmptyString;
++ }
++
++ const struct PaHostApiInfo *apiinfo = Pa_GetHostApiInfo(index); // get info on API
+ wxLogDebug(wxT("GetDefaultRecordDevice(): HostAPI index %d, name %s"), index, wxString(apiinfo->name, wxConvLocal).c_str());
+ wxLogDebug(wxT("GetDefaultRecordDevice() default input %d"), apiinfo->defaultInputDevice);
+ const PaDeviceInfo* devinfo = Pa_GetDeviceInfo(apiinfo->defaultInputDevice);
--
Audacity debian packaging
More information about the pkg-multimedia-commits
mailing list