gst/audioresample/gstaudioresample.c: Don't leak all input buffers to audioresample.
authorMichael Smith <msmith@xiph.org>
Thu, 15 Dec 2005 10:30:14 +0000 (10:30 +0000)
committerMichael Smith <msmith@xiph.org>
Thu, 15 Dec 2005 10:30:14 +0000 (10:30 +0000)
Original commit message from CVS:
* gst/audioresample/gstaudioresample.c:
Don't leak all input buffers to audioresample.

gst/audioresample/gstaudioresample.c

index 16c01a79dd0fc263f6f0ed21bbd99bf5ac09b749..e907dbfae059ffc8f54830f0c568d2a542054103 100644 (file)
@@ -480,7 +480,7 @@ static GstFlowReturn
 {
   GstAudioresample *audioresample;
   ResampleState *r;
-  guchar *data;
+  guchar *data, *datacopy;
   gulong size;
   GstClockTime timestamp;
 
@@ -514,7 +514,8 @@ static GstFlowReturn
   }
 
   /* need to memdup, resample takes ownership. */
-  resample_add_input_data (r, g_memdup (data, size), size, NULL, NULL);
+  datacopy = g_memdup (data, size);
+  resample_add_input_data (r, datacopy, size, g_free, datacopy);
 
   return audioresample_do_output (audioresample, outbuf);
 }