[xiph-commits] r13263 - trunk/vorbis-tools/oggdec

imalone at svn.xiph.org imalone at svn.xiph.org
Sun Jul 15 08:33:04 PDT 2007


Author: imalone
Date: 2007-07-15 08:33:04 -0700 (Sun, 15 Jul 2007)
New Revision: 13263

Modified:
   trunk/vorbis-tools/oggdec/oggdec.c
Log:
Fix oggdec outputting from empty buffer if permute channels hadn't been used

Modified: trunk/vorbis-tools/oggdec/oggdec.c
===================================================================
--- trunk/vorbis-tools/oggdec/oggdec.c	2007-07-15 15:23:04 UTC (rev 13262)
+++ trunk/vorbis-tools/oggdec/oggdec.c	2007-07-15 15:33:04 UTC (rev 13263)
@@ -255,6 +255,7 @@
     OggVorbis_File vf;
     int bs = 0;
     char buf[8192], outbuf[8192];
+    char *p_outbuf;
     int buflen = 8192;
     unsigned int written = 0;
     int ret;
@@ -324,9 +325,13 @@
         if(channels > 2 && !raw) {
           /* Then permute! */
           permute_channels(buf, outbuf, ret, channels, bits/8);
+          p_outbuf = outbuf;
         }
+        else {
+          p_outbuf = buf;
+        }
 
-        if(fwrite(outbuf, 1, ret, out) != ret) {
+        if(fwrite(p_outbuf, 1, ret, out) != ret) {
             fprintf(stderr, "Error writing to file: %s\n", strerror(errno));
             ov_clear(&vf);
             return 1;



More information about the commits mailing list