summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_ogg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/demuxers/demux_ogg.c')
-rw-r--r--src/demuxers/demux_ogg.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c
index 573baa593..e0abd0cd6 100644
--- a/src/demuxers/demux_ogg.c
+++ b/src/demuxers/demux_ogg.c
@@ -446,6 +446,7 @@ static const struct ogg_meta {
OGG_META (COMMENT, 0),
};
+#if 0
/* ensure that those marked "append" are cleared */
/* FIXME: is this useful? Should they be cleared on first write? */
static void prepare_read_comments (demux_ogg_t *this)
@@ -458,6 +459,7 @@ static void prepare_read_comments (demux_ogg_t *this)
this->meta[metadata[i].meta] = NULL;
}
}
+#endif
static int read_comments (demux_ogg_t *this, const char *comment)
{
@@ -468,9 +470,10 @@ static int read_comments (demux_ogg_t *this, const char *comment)
if (!strncasecmp (metadata[i].tag, comment, ml) && comment[ml]) {
if (metadata[i].append && this->meta[metadata[i].meta]) {
char *newstr;
- asprintf (&newstr, "%s\n%s", this->meta[metadata[i].meta], comment + ml);
- free (this->meta[metadata[i].meta]);
- this->meta[metadata[i].meta] = newstr;
+ if (asprintf (&newstr, "%s\n%s", this->meta[metadata[i].meta], comment + ml) >= 0) {
+ free (this->meta[metadata[i].meta]);
+ this->meta[metadata[i].meta] = newstr;
+ }
}
else {
free (this->meta[metadata[i].meta]);