summaryrefslogtreecommitdiffstats
path: root/gst-libs/gst/resample/resample.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-12-16 11:39:00 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-12-16 11:39:00 +0000
commit2439970ffd86abc943a7d67679aad645e2230f70 (patch)
treeb02d2cd6f280b6695dfbe583442ec3dbf03a5521 /gst-libs/gst/resample/resample.c
parent839354ce28f9aeb3d912e1d3398f3d64f98a9717 (diff)
downloadgst-plugins-bad-2439970ffd86abc943a7d67679aad645e2230f70.tar.gz
gst-plugins-bad-2439970ffd86abc943a7d67679aad645e2230f70.tar.bz2
gst-plugins-bad-2439970ffd86abc943a7d67679aad645e2230f70.zip
gst/: Fix memleak (#159215).
Original commit message from CVS: Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net> * gst-libs/gst/resample/resample.c: (gst_resample_close): * gst-libs/gst/resample/resample.h: * gst/audioscale/gstaudioscale.c: Fix memleak (#159215).
Diffstat (limited to 'gst-libs/gst/resample/resample.c')
-rw-r--r--gst-libs/gst/resample/resample.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/gst-libs/gst/resample/resample.c b/gst-libs/gst/resample/resample.c
index 63ade390..cd899159 100644
--- a/gst-libs/gst/resample/resample.c
+++ b/gst-libs/gst/resample/resample.c
@@ -133,6 +133,22 @@ gst_resample_reinit (gst_resample_t * r)
}
}
+void
+gst_resample_close (gst_resample_t * r)
+{
+ if (r->buffer) {
+ free (r->buffer);
+ r->buffer = NULL;
+ r->buffer_len = 0;
+ }
+ if (r->hack_union.s.out_tmp) {
+ free (r->hack_union.s.out_tmp);
+ r->hack_union.s.out_tmp = NULL;
+ r->hack_union.s.out_tmp_len = 0;
+ }
+
+}
+
/*
* Prepare to be confused.
*
@@ -252,8 +268,7 @@ gst_resample_nearest_s16 (gst_resample_t * r)
SCALE_LOOP (o_ptr[0] = i_ptr[0], 1);
break;
case 2:
- SCALE_LOOP (o_ptr[0] = i_ptr[0];
- o_ptr[1] = i_ptr[1], 2);
+ SCALE_LOOP (o_ptr[0] = i_ptr[0]; o_ptr[1] = i_ptr[1], 2);
break;
default:
{
@@ -612,8 +627,7 @@ gst_resample_nearest_float (gst_resample_t * r)
SCALE_LOOP (o_ptr[0] = i_ptr[0], 1);
break;
case 2:
- SCALE_LOOP (o_ptr[0] = i_ptr[0];
- o_ptr[1] = i_ptr[1], 2);
+ SCALE_LOOP (o_ptr[0] = i_ptr[0]; o_ptr[1] = i_ptr[1], 2);
break;
default:
{