[xiph-commits] r3373 - libfishsound/branches/1.0-stable/src/libfishsound

conrad at svn.annodex.net conrad at svn.annodex.net
Sun Jan 20 20:40:20 PST 2008


Author: conrad
Date: 2008-01-20 20:40:18 -0800 (Sun, 20 Jan 2008)
New Revision: 3373

Modified:
   libfishsound/branches/1.0-stable/src/libfishsound/flac.c
Log:
initialize FLAC encode buffer pointer to avoid unmatched free when deleting
an unused encoder


Modified: libfishsound/branches/1.0-stable/src/libfishsound/flac.c
===================================================================
--- libfishsound/branches/1.0-stable/src/libfishsound/flac.c	2008-01-21 04:05:21 UTC (rev 3372)
+++ libfishsound/branches/1.0-stable/src/libfishsound/flac.c	2008-01-21 04:40:18 UTC (rev 3373)
@@ -675,7 +675,10 @@
       FLAC__stream_encoder_finish(fi->fse);
       FLAC__stream_encoder_delete(fi->fse);
     }
-    if (fi->buffer) fs_free(fi->buffer);
+    if (fi->buffer) {
+      fs_free(fi->buffer);
+      fi->buffer = NULL;
+    }
   }
 
   if (fi->ipcm) fs_free(fi->ipcm);
@@ -741,11 +744,12 @@
 
   fi = fs_malloc (sizeof (FishSoundFlacInfo));
   if (fi == NULL) return NULL;
+  fi->fsd = NULL;
+  fi->fse = NULL;
+  fi->buffer = NULL;
   fi->packetno = 0;
   fi->header = 0;
   fi->header_packets = 0;
-  fi->fsd = NULL;
-  fi->fse = NULL;
 
   fi->ipcm = NULL;
   for (i = 0; i < 8; i++) {



More information about the commits mailing list