[xiph-commits] r18115 - trunk/vorbis/lib
tterribe at svn.xiph.org
tterribe at svn.xiph.org
Fri Nov 4 16:55:47 PDT 2011
Author: tterribe
Date: 2011-11-04 16:55:47 -0700 (Fri, 04 Nov 2011)
New Revision: 18115
Modified:
trunk/vorbis/lib/info.c
Log:
Fix a memory leak in vorbis_commentheader_out().
Fixes #1840.
Thanks to Alexandru Munteanu for the patch.
Modified: trunk/vorbis/lib/info.c
===================================================================
--- trunk/vorbis/lib/info.c 2011-11-01 20:27:44 UTC (rev 18114)
+++ trunk/vorbis/lib/info.c 2011-11-04 23:55:47 UTC (rev 18115)
@@ -550,7 +550,10 @@
oggpack_buffer opb;
oggpack_writeinit(&opb);
- if(_vorbis_pack_comment(&opb,vc)) return OV_EIMPL;
+ if(_vorbis_pack_comment(&opb,vc)){
+ oggpack_writeclear(&opb);
+ return OV_EIMPL;
+ }
op->packet = _ogg_malloc(oggpack_bytes(&opb));
memcpy(op->packet, opb.buffer, oggpack_bytes(&opb));
@@ -561,6 +564,7 @@
op->granulepos=0;
op->packetno=1;
+ oggpack_writeclear(&opb);
return 0;
}
More information about the commits
mailing list