[xiph-commits] r17519 - trunk/Tremor
tterribe at svn.xiph.org
tterribe at svn.xiph.org
Wed Oct 13 16:37:40 PDT 2010
Author: tterribe
Date: 2010-10-13 16:37:40 -0700 (Wed, 13 Oct 2010)
New Revision: 17519
Modified:
trunk/Tremor/info.c
Log:
Port r14984 from libvorbis.
Correct an accidental dereference-before-check in error cleanup in comments.
Modified: trunk/Tremor/info.c
===================================================================
--- trunk/Tremor/info.c 2010-10-13 23:28:48 UTC (rev 17518)
+++ trunk/Tremor/info.c 2010-10-13 23:37:40 UTC (rev 17519)
@@ -92,10 +92,12 @@
void vorbis_comment_clear(vorbis_comment *vc){
if(vc){
long i;
- for(i=0;i<vc->comments;i++)
- if(vc->user_comments[i])_ogg_free(vc->user_comments[i]);
- if(vc->user_comments)_ogg_free(vc->user_comments);
- if(vc->comment_lengths)_ogg_free(vc->comment_lengths);
+ if(vc->user_comments){
+ for(i=0;i<vc->comments;i++)
+ if(vc->user_comments[i])_ogg_free(vc->user_comments[i]);
+ _ogg_free(vc->user_comments);
+ }
+ if(vc->comment_lengths)_ogg_free(vc->comment_lengths);
if(vc->vendor)_ogg_free(vc->vendor);
memset(vc,0,sizeof(*vc));
}
More information about the commits
mailing list