Skip to content
Permalink
Browse files

Fix crash when a playlist plugin does not provide save(). Closes: #371.

  • Loading branch information...
jlindgren90 committed Nov 22, 2013
1 parent 2e53b7a commit 5fa9c0aa1b84992d922db573b75f672a28907bd3
Showing with 10 additions and 4 deletions.
  1. +10 −4 src/audacious/playlist-files.c
@@ -47,10 +47,9 @@ static PluginHandle * get_plugin (const char * filename, bool_t saving)

if (! plugin)
{
char * error = str_printf (_("Cannot %s %s: unsupported file "
"extension."), saving ? _("save") : _("load"), filename);
SPRINTF (error, _("Cannot %s %s: unsupported file extension."),
saving ? _("save") : _("load"), filename);
interface_show_error (error);
str_unref (error);
return NULL;
}

@@ -127,7 +126,14 @@ bool_t playlist_save (int list, const char * filename)
return FALSE;

PlaylistPlugin * pp = plugin_get_header (plugin);
g_return_val_if_fail (pp && PLUGIN_HAS_FUNC (pp, load), FALSE);
g_return_val_if_fail (pp, FALSE);

if (! PLUGIN_HAS_FUNC (pp, save))
{
SPRINTF (error, _("Cannot save %s: plugin does not support saving."), filename);
interface_show_error (error);
return FALSE;
}

bool_t fast = get_bool (NULL, "metadata_on_play");

0 comments on commit 5fa9c0a

Please sign in to comment.
You can’t perform that action at this time.