aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/flac_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-07-06 22:09:30 +0200
committerMax Kellermann <max@duempel.org>2009-07-06 22:09:30 +0200
commitc0c5119788c24832ee548df7f3f72742c878e906 (patch)
tree5b777696ba8c0778945857773d75eb69913253df /src/decoder/flac_plugin.c
parent64ca94c91020626edf626a7e639e168dba9e7d74 (diff)
downloadmpd-c0c5119788c24832ee548df7f3f72742c878e906.tar.gz
mpd-c0c5119788c24832ee548df7f3f72742c878e906.tar.xz
mpd-c0c5119788c24832ee548df7f3f72742c878e906.zip
decoder/flac: fix assertion failure in tag_free() call
Initialize flac_data.tag right after flac_data_init(). This way, the "goto fail" won't jump to the point where tag_free(NULL) can be called.
Diffstat (limited to 'src/decoder/flac_plugin.c')
-rw-r--r--src/decoder/flac_plugin.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/decoder/flac_plugin.c b/src/decoder/flac_plugin.c
index 965a8b46b..1d7a9f868 100644
--- a/src/decoder/flac_plugin.c
+++ b/src/decoder/flac_plugin.c
@@ -394,6 +394,7 @@ flac_decode_internal(struct decoder * decoder,
if (!(flac_dec = flac_new()))
return;
flac_data_init(&data, decoder, input_stream);
+ data.tag = tag_new();
#if defined(FLAC_API_VERSION_CURRENT) && FLAC_API_VERSION_CURRENT > 7
if(!FLAC__stream_decoder_set_metadata_respond(flac_dec, FLAC__METADATA_TYPE_VORBIS_COMMENT))
@@ -422,8 +423,6 @@ flac_decode_internal(struct decoder * decoder,
}
}
- data.tag = tag_new();
-
if (!flac_process_metadata(flac_dec)) {
err = "problem reading metadata";
goto fail;