Package: zynaddsubfx
Version: 2.2.1-2.1
Severity: normal

Zynaddsubfx crashes when pressing black keys on the virtual keyboard.
This is because of a missing check in VirKeyboard::presskey() if nk is a
valid key. The attached patch fixes this bug, and also fixes the only
three compiler warnings (using a char as array index, and non-virtual
destructors in classes with virtual functions).

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15
Locale: LANG=nl_NL.UTF-8, LC_CTYPE=nl_NL.UTF-8 (charmap=UTF-8)

Versions of packages zynaddsubfx depends on:
ii  fftw3                     3.0.1-14       library for computing Fast Fourier
ii  libasound2                1.0.10-2       ALSA library
ii  libc6                     2.3.5-12       GNU C Library: Shared libraries an
ii  libfltk1.1                1.1.6-10       Fast Light Toolkit shared librarie
ii  libgcc1                   1:4.1-0exp4    GCC support library
ii  libjack0.100.0-0          0.100.0-4      JACK Audio Connection Kit (librari
ii  libmxml1                  2.2-1          development files for libmlxml
ii  libstdc++6                4.0.2-7        The GNU Standard C++ Library v3
ii  libx11-6                  6.9.0.dfsg.1-4 X Window System protocol client li
ii  libxext6                  6.9.0.dfsg.1-4 X Window System miscellaneous exte
ii  libxft2                   2.1.8.2-2      FreeType-based font drawing librar
ii  xlibs                     6.9.0.dfsg.1-4 X Window System client libraries m
ii  zlib1g                    1:1.2.3-9      compression library - runtime

zynaddsubfx recommends no packages.

-- no debconf information
--- zynaddsubfx-2.2.1.orig/src/Params/EnvelopeParams.C
+++ zynaddsubfx-2.2.1/src/Params/EnvelopeParams.C
@@ -51,7 +51,7 @@
 };
 
 REALTYPE EnvelopeParams::getdt(char i){
-    REALTYPE result=(pow(2.0,Penvdt[i]/127.0*12.0)-1.0)*10.0;//miliseconds
+    REALTYPE result=(pow(2.0,Penvdt[(int)i]/127.0*12.0)-1.0)*10.0;//miliseconds
     return(result);
 };
 
--- zynaddsubfx-2.2.1.orig/src/UI/BankUI.fl
+++ zynaddsubfx-2.2.1/src/UI/BankUI.fl
@@ -35,6 +35,8 @@
   } {}
   decl {Bank *bank;} {public
   }
+  Function {~BankProcess_()} {return_type virtual
+  } {code {} {}}
 } 
 
 class BankSlot {: {public Fl_Button,BankProcess_}
--- zynaddsubfx-2.2.1.orig/src/UI/PartUI.fl
+++ zynaddsubfx-2.2.1/src/UI/PartUI.fl
@@ -86,6 +86,8 @@
 class PartUI_ {} {
   Function {showparameters(int kititem,int engine)} {return_type virtual
   } {}
+  Function {~PartUI_()} {return_type virtual} { code {} {}
+  }
 } 
 
 class PartKitItem {: {public Fl_Group}
--- zynaddsubfx-2.2.1.orig/src/UI/VirKeyboard.fl
+++ zynaddsubfx-2.2.1/src/UI/VirKeyboard.fl
@@ -168,7 +168,8 @@
   }
   Function {presskey(int nk,int exclusive,int type)} {} {
     code {if (nk>=N_OCT*12) return;
-if ((nk<0)&&(exclusive==0)) {
+if ((nk<0)) {
+  if(exclusive==0)
   relaseallkeys(type);
   return;
 };

Reply via email to