summaryrefslogtreecommitdiff
path: root/src/libFLAC/metadata_object.c
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2015-07-05 20:54:28 +1000
committerErik de Castro Lopo <erikd@mega-nerd.com>2015-07-05 20:57:39 +1000
commitd939b44a20dbeb5234ac8b4ae9de0750f5a5de7c (patch)
treea9f63236be2757ca07ef717cfdd32c89b92eeb67 /src/libFLAC/metadata_object.c
parentbc5113007a53be2c621d5eb5f4485eddf947ef37 (diff)
downloadflac-d939b44a20dbeb5234ac8b4ae9de0750f5a5de7c.tar.gz
libFLAC: Improve fix in bc5113007a
The assert that was removed in bc5113007a, was a result of error handling in read_metadata_vorbiscomment_() which set obj->num_comments to zero, without freeing obj->comments and setting it to NULL. This commit also restores the assert that was removed.
Diffstat (limited to 'src/libFLAC/metadata_object.c')
-rw-r--r--src/libFLAC/metadata_object.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libFLAC/metadata_object.c b/src/libFLAC/metadata_object.c
index 33a2b555..a799bf85 100644
--- a/src/libFLAC/metadata_object.c
+++ b/src/libFLAC/metadata_object.c
@@ -567,6 +567,7 @@ FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_clone(const FLAC__StreamMet
return 0;
}
if(object->data.vorbis_comment.num_comments == 0) {
+ FLAC__ASSERT(0 == object->data.vorbis_comment.comments);
to->data.vorbis_comment.comments = 0;
}
else {