Commit 6db2e784 authored by Michael Smith's avatar Michael Smith
Browse files

Fix same bug as was fixed in libvorbis here.

svn path=/trunk/vorbis-tools/; revision=2157
parent 42301799
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Comment editing backend, suitable for use by nice frontend interfaces. * Comment editing backend, suitable for use by nice frontend interfaces.
* *
* last modified: $Id: vcedit.c,v 1.13 2001/08/15 08:33:26 msmith Exp $ * last modified: $Id: vcedit.c,v 1.14 2001/10/18 10:28:17 msmith Exp $
*/ */
#include <stdio.h> #include <stdio.h>
...@@ -76,9 +76,9 @@ void vcedit_clear(vcedit_state *state) ...@@ -76,9 +76,9 @@ void vcedit_clear(vcedit_state *state)
/* Next two functions pulled straight from libvorbis, apart from one change /* Next two functions pulled straight from libvorbis, apart from one change
* - we don't want to overwrite the vendor string. * - we don't want to overwrite the vendor string.
*/ */
static void _v_writestring(oggpack_buffer *o,char *s) static void _v_writestring(oggpack_buffer *o,char *s, int len)
{ {
while(*s) while(len--)
{ {
oggpack_write(o,*s++,8); oggpack_write(o,*s++,8);
} }
...@@ -92,11 +92,11 @@ static int _commentheader_out(vorbis_comment *vc, char *vendor, ogg_packet *op) ...@@ -92,11 +92,11 @@ static int _commentheader_out(vorbis_comment *vc, char *vendor, ogg_packet *op)
/* preamble */ /* preamble */
oggpack_write(&opb,0x03,8); oggpack_write(&opb,0x03,8);
_v_writestring(&opb,"vorbis"); _v_writestring(&opb,"vorbis", 6);
/* vendor */ /* vendor */
oggpack_write(&opb,strlen(vendor),32); oggpack_write(&opb,strlen(vendor),32);
_v_writestring(&opb,vendor); _v_writestring(&opb,vendor, strlen(vendor));
/* comments */ /* comments */
oggpack_write(&opb,vc->comments,32); oggpack_write(&opb,vc->comments,32);
...@@ -105,7 +105,8 @@ static int _commentheader_out(vorbis_comment *vc, char *vendor, ogg_packet *op) ...@@ -105,7 +105,8 @@ static int _commentheader_out(vorbis_comment *vc, char *vendor, ogg_packet *op)
for(i=0;i<vc->comments;i++){ for(i=0;i<vc->comments;i++){
if(vc->user_comments[i]){ if(vc->user_comments[i]){
oggpack_write(&opb,vc->comment_lengths[i],32); oggpack_write(&opb,vc->comment_lengths[i],32);
_v_writestring(&opb,vc->user_comments[i]); _v_writestring(&opb,vc->user_comments[i],
vc->comment_lengths[i]);
}else{ }else{
oggpack_write(&opb,0,32); oggpack_write(&opb,0,32);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment