Mercurial > audlegacy
diff Plugins/Input/flac/tag.c @ 1244:1a93e6f2c98d trunk
[svn] - fix some possible segmentation violations
author | nenolod |
---|---|
date | Wed, 14 Jun 2006 23:58:18 -0700 |
parents | 924181beaa91 |
children | 74aa6a352a0c |
line wrap: on
line diff
--- a/Plugins/Input/flac/tag.c Wed Jun 14 23:24:23 2006 -0700 +++ b/Plugins/Input/flac/tag.c Wed Jun 14 23:58:18 2006 -0700 @@ -52,7 +52,7 @@ static char *local__getstr(char* str) { if (str && strlen(str) > 0) - return str; + return g_strdup(str); return NULL; } @@ -90,8 +90,9 @@ TitleInput *input = NULL; FLAC__StreamMetadata *tags; char *title, *artist, *performer, *album, *date, *tracknumber, *genre, *description; + gchar *filename_proxy = g_strdup(filename); - FLAC_plugin__tags_get(filename, &tags); + FLAC_plugin__tags_get(filename_proxy, &tags); title = local__getfield(tags, "TITLE"); artist = local__getfield(tags, "ARTIST"); @@ -114,9 +115,9 @@ input->genre = local__getstr(genre); input->comment = local__getstr(description); - input->file_name = g_path_get_basename(filename); - input->file_path = filename; - input->file_ext = local__extname(filename); + input->file_name = g_path_get_basename(filename_proxy); + input->file_path = filename_proxy; + input->file_ext = local__extname(filename_proxy); return input; }