[xiph-commits] r3725 - liboggz/trunk/src/tools

conrad at svn.annodex.net conrad at svn.annodex.net
Wed Sep 24 02:09:00 PDT 2008


Author: conrad
Date: 2008-09-24 02:08:59 -0700 (Wed, 24 Sep 2008)
New Revision: 3725

Modified:
   liboggz/trunk/src/tools/oggz-comment.c
Log:
fix oggz-comment writing bad data into streams
Patch by ogg.k.ogg.k:

I spent a while working out why ogginfo reported holes in one of my
streams - turns out oggz-comment writes bad data into the stream,
and oggz-validate doesn't see it (should it ?), oggz-dump displays
correct data, etc. Eventually, some combination of xxd and comparing
byte offsets led me to it... two hours later...


Modified: liboggz/trunk/src/tools/oggz-comment.c
===================================================================
--- liboggz/trunk/src/tools/oggz-comment.c	2008-09-20 09:44:46 UTC (rev 3724)
+++ liboggz/trunk/src/tools/oggz-comment.c	2008-09-24 09:08:59 UTC (rev 3725)
@@ -293,8 +293,9 @@
   /* First, process headers packet-by-packet. */
   oggz_set_read_callback (ocdata->reader, -1, read_packet, ocdata);
   while ((n = oggz_read (ocdata->reader, 1024)) > 0) {
-    while (oggz_write_output (ocdata->writer, buf, n) > 0) {
-      fwrite (buf, 1, n, ocdata->outfile);
+    long nn;
+    while ((nn=oggz_write_output (ocdata->writer, buf, n)) > 0) {
+      fwrite (buf, 1, nn, ocdata->outfile);
     }
   }
 



More information about the commits mailing list