summaryrefslogtreecommitdiff
path: root/plugins/converter/converter.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-12-18 13:46:58 +0100
committerGravatar waker <wakeroid@gmail.com>2011-12-18 13:46:58 +0100
commit1d307b9f84fb73ab7b047ec15b70cbe53225a962 (patch)
tree53fe7dffea23a8e5b6375594b3cdd4e250eb0034 /plugins/converter/converter.c
parent727d44ab2f9b67c5f6b59484b3016f1a44f93215 (diff)
converter: disallow empty preset titles
Diffstat (limited to 'plugins/converter/converter.c')
-rw-r--r--plugins/converter/converter.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/converter/converter.c b/plugins/converter/converter.c
index 39604785..84d73748 100644
--- a/plugins/converter/converter.c
+++ b/plugins/converter/converter.c
@@ -149,6 +149,10 @@ encoder_preset_load (const char *fname) {
// @return -1 on path/write error, -2 if file already exists
int
encoder_preset_save (ddb_encoder_preset_t *p, int overwrite) {
+ if (!p->title || !p->title[0]) {
+ fprintf (stderr, "encoder_preset_save: empty title\n");
+ return -1;
+ }
const char *confdir = deadbeef->get_config_dir ();
char path[1024];
if (snprintf (path, sizeof (path), "%s/presets", confdir) < 0) {
@@ -349,6 +353,10 @@ dsp_preset_load (const char *fname) {
int
dsp_preset_save (ddb_dsp_preset_t *p, int overwrite) {
+ if (!p->title || !p->title[0]) {
+ fprintf (stderr, "dsp_preset_save: empty title\n");
+ return -1;
+ }
const char *confdir = deadbeef->get_config_dir ();
char path[1024];
if (snprintf (path, sizeof (path), "%s/presets", confdir) < 0) {