aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/oggvorbis_plugin.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/decoder/oggvorbis_plugin.c b/src/decoder/oggvorbis_plugin.c
index f6be8562a..5aa777065 100644
--- a/src/decoder/oggvorbis_plugin.c
+++ b/src/decoder/oggvorbis_plugin.c
@@ -327,16 +327,19 @@ oggvorbis_decode(struct decoder *decoder, struct input_stream *inStream)
static struct tag *oggvorbis_TagDup(const char *file)
{
- char *duplicated;
- int err;
struct tag *ret;
+ FILE *fp;
OggVorbis_File vf;
- duplicated = g_strdup(file);
- err = ov_fopen(duplicated, &vf);
- g_free(duplicated);
- if (err < 0)
+ fp = fopen(file, "r");
+ if (!fp) {
return NULL;
+ }
+
+ if (ov_open(fp, &vf, NULL, 0) < 0) {
+ fclose(fp);
+ return NULL;
+ }
ret = oggCommentsParse(ov_comment(&vf, -1)->user_comments);