mirror of
https://git.freebsd.org/ports.git
synced 2025-05-01 11:06:39 -04:00
audio/zynaddsubfx: Fix buffer overflows
- Leave room for termination NUL in sscanf buffer. - Use float instead of float_t. On FreeBSD/i386 they are not the same. Discovered during an exp-run for bug 276478.
This commit is contained in:
parent
9827f3b510
commit
0eb74bac9c
4 changed files with 34 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
PORTNAME= zynaddsubfx
|
||||
DISTVERSION= 3.0.6
|
||||
PORTREVISION= 2
|
||||
PORTREVISION= 3
|
||||
PORTEPOCH= 2
|
||||
CATEGORIES= audio
|
||||
|
||||
|
|
11
audio/zynaddsubfx/files/patch-rtosc_src_cpp_savefile.cpp
Normal file
11
audio/zynaddsubfx/files/patch-rtosc_src_cpp_savefile.cpp
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- rtosc/src/cpp/savefile.cpp.orig 2021-12-31 15:58:28 UTC
|
||||
+++ rtosc/src/cpp/savefile.cpp
|
||||
@@ -534,7 +534,7 @@ int load_from_file(const char* file_content,
|
||||
n = 0;
|
||||
|
||||
sscanf(file_content,
|
||||
- "%% %128s v%u.%u.%u%n ", appbuf, &vma, &vmi, &vre, &n);
|
||||
+ "%% %127s v%u.%u.%u%n ", appbuf, &vma, &vmi, &vre, &n);
|
||||
if(n <= 0 || strcmp(appbuf, appname) || vma > 255 || vmi > 255 || vre > 255)
|
||||
return -bytes_read-1;
|
||||
|
11
audio/zynaddsubfx/files/patch-src_Effects_Distorsion.cpp
Normal file
11
audio/zynaddsubfx/files/patch-src_Effects_Distorsion.cpp
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- src/Effects/Distorsion.cpp.orig 2022-01-22 01:46:21 UTC
|
||||
+++ src/Effects/Distorsion.cpp
|
||||
@@ -75,7 +75,7 @@ rtosc::Ports Distorsion::ports = {
|
||||
|
||||
for(int i=0; i<128; ++i)
|
||||
buffer[i] = 2*(i/128.0)-1;
|
||||
- memcpy(orig, buffer, sizeof(float_t)*128);
|
||||
+ memcpy(orig, buffer, sizeof(buffer));
|
||||
|
||||
waveShapeSmps(sizeof(buffer)/sizeof(buffer[0]), buffer,
|
||||
dd.Ptype + 1, dd.Pdrive, dd.Poffset, dd.Pfuncpar);
|
11
audio/zynaddsubfx/files/patch-src_Synth_ADnote.cpp
Normal file
11
audio/zynaddsubfx/files/patch-src_Synth_ADnote.cpp
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- src/Synth/ADnote.cpp.orig 2022-01-22 01:46:21 UTC
|
||||
+++ src/Synth/ADnote.cpp
|
||||
@@ -1264,7 +1264,7 @@ inline void ADnote::ComputeVoiceOscillator_SincInterpo
|
||||
inline void ADnote::ComputeVoiceOscillator_SincInterpolation(int nvoice)
|
||||
{
|
||||
// windowed sinc kernel factor Fs*0.3, rejection 80dB
|
||||
- const float_t kernel[] = {
|
||||
+ const float kernel[] = {
|
||||
0.0010596256917418426f,
|
||||
0.004273442181254887f,
|
||||
0.0035466063043375785f,
|
Loading…
Add table
Reference in a new issue