Browse Source

fixed: bus error crash on FreeBSD with non-ASCII characters

WIP: #2
main
Tomasz Sowa 5 months ago
parent
commit
e9763fe90b
  1. 33
      audio/deadbeef/files/patch-conf.c
  2. 18
      audio/deadbeef/files/patch-junklib.c
  3. 11
      audio/deadbeef/files/patch-plugins_supereq_Equ.cpp
  4. 11
      audio/deadbeef/files/patch-streamer.c

33
audio/deadbeef/files/patch-conf.c

@ -0,0 +1,33 @@
--- conf.c.orig 2016-04-24 23:38:13.000000000 +0200
+++ conf.c 2018-01-23 21:19:11.961166000 +0100
@@ -243,24 +243,27 @@
conf_get_float (const char *key, float def) {
conf_lock ();
const char *v = conf_get_str_fast (key, NULL);
+ float res = v ? atof (v) : def;
conf_unlock ();
- return v ? atof (v) : def;
+ return res;
}
int
conf_get_int (const char *key, int def) {
conf_lock ();
const char *v = conf_get_str_fast (key, NULL);
+ int res = v ? atoi (v) : def;
conf_unlock ();
- return v ? atoi (v) : def;
+ return res;
}
int64_t
conf_get_int64 (const char *key, int64_t def) {
conf_lock ();
const char *v = conf_get_str_fast (key, NULL);
+ int64_t res = v ? atoll (v) : def;
conf_unlock ();
- return v ? atoll (v) : def;
+ return res;
}
DB_conf_item_t *

18
audio/deadbeef/files/patch-junklib.c

@ -1,5 +1,5 @@
--- junklib.c.orig 2016-04-24 21:38:13 UTC
+++ junklib.c
--- junklib.c.origin 2018-01-23 21:30:39.017506000 +0100
+++ junklib.c 2018-01-23 21:31:05.522020000 +0100
@@ -33,7 +33,6 @@
#include <string.h>
#undef HAVE_ICI
@ -8,3 +8,17 @@
#include <iconv.h>
#elif HAVE_ICU
#warning icu
@@ -1025,11 +1024,12 @@
return -1;
}
+ const char *cs = NULL;
+
if (it) {
if (memcmp (buffer, "TAG", 3)) {
return -1; // no tag
}
- const char *cs = NULL;
charset = &cs;
int res = junk_id3v1_read_int (NULL, buffer, charset);
if (res) {

11
audio/deadbeef/files/patch-plugins_supereq_Equ.cpp

@ -0,0 +1,11 @@
--- plugins/supereq/Equ.cpp.orig 2016-04-24 23:38:13.000000000 +0200
+++ plugins/supereq/Equ.cpp 2018-01-23 21:15:10.046758000 +0100
@@ -231,7 +231,7 @@
{
(*pp) = new paramlistelm;
(*pp)->lower = i == 0 ? 0 : bands[i-1];
- (*pp)->upper = i == NBANDS-1 ? fs : bands[i ];
+ (*pp)->upper = i == NBANDS ? fs : bands[i ];
(*pp)->gain = bc[i];
}

11
audio/deadbeef/files/patch-streamer.c

@ -0,0 +1,11 @@
--- streamer.c.orig 2016-04-24 23:38:13.000000000 +0200
+++ streamer.c 2018-01-23 21:17:36.667778000 +0100
@@ -1993,7 +1993,7 @@
int n = 0;
for (;;) {
- char value[1000];
+ char value[1001];
if (!fgets (temp, sizeof (temp), fp)) {
fprintf (stderr, "streamer_dsp_chain_load: unexpected eof while reading plugin params\n");
goto error;
Loading…
Cancel
Save