summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-07-11 16:29:02 +0200
committerChristian König <[email protected]>2011-07-11 16:29:02 +0200
commitdf5e0b9435c869f88234a69db9bfe97342b027d4 (patch)
treedba46740cec2d3da73fd6d9522af7d2b770162c0 /src/gallium/auxiliary
parenta7ec477ebc8b256381854f1cef0ec03a2d713555 (diff)
[g3dvl] fix a whole bunch of memory leaks
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/vl/vl_idct.c12
-rw-r--r--src/gallium/auxiliary/vl/vl_mpeg12_decoder.c1
-rw-r--r--src/gallium/auxiliary/vl/vl_video_buffer.c2
3 files changed, 11 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/vl/vl_idct.c b/src/gallium/auxiliary/vl/vl_idct.c
index 45180499e2e..744a35603d7 100644
--- a/src/gallium/auxiliary/vl/vl_idct.c
+++ b/src/gallium/auxiliary/vl/vl_idct.c
@@ -749,7 +749,8 @@ bool vl_idct_init(struct vl_idct *idct, struct pipe_context *pipe,
struct pipe_sampler_view *matrix,
struct pipe_sampler_view *transpose)
{
- assert(idct && pipe && matrix);
+ assert(idct && pipe);
+ assert(matrix && transpose);
idct->pipe = pipe;
idct->buffer_width = buffer_width;
@@ -777,6 +778,7 @@ vl_idct_cleanup(struct vl_idct *idct)
cleanup_state(idct);
pipe_sampler_view_reference(&idct->matrix, NULL);
+ pipe_sampler_view_reference(&idct->transpose, NULL);
}
bool
@@ -784,9 +786,8 @@ vl_idct_init_buffer(struct vl_idct *idct, struct vl_idct_buffer *buffer,
struct pipe_sampler_view *source,
struct pipe_sampler_view *intermediate)
{
- assert(buffer);
- assert(idct);
- assert(source);
+ assert(buffer && idct);
+ assert(source && intermediate);
memset(buffer, 0, sizeof(struct vl_idct_buffer));
@@ -811,6 +812,9 @@ vl_idct_cleanup_buffer(struct vl_idct *idct, struct vl_idct_buffer *buffer)
cleanup_source(idct, buffer);
cleanup_intermediate(idct, buffer);
+
+ pipe_sampler_view_reference(&buffer->sampler_views.individual.matrix, NULL);
+ pipe_sampler_view_reference(&buffer->sampler_views.individual.transpose, NULL);
}
void
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
index b866e0e5aec..7bb5a695e40 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
@@ -447,6 +447,7 @@ vl_mpeg12_destroy(struct pipe_video_decoder *decoder)
pipe_resource_reference(&dec->quads.buffer, NULL);
pipe_resource_reference(&dec->pos.buffer, NULL);
+ pipe_resource_reference(&dec->block_num.buffer, NULL);
pipe_sampler_view_reference(&dec->zscan_linear, NULL);
pipe_sampler_view_reference(&dec->zscan_normal, NULL);
diff --git a/src/gallium/auxiliary/vl/vl_video_buffer.c b/src/gallium/auxiliary/vl/vl_video_buffer.c
index 49b7b50cfee..8b05749659f 100644
--- a/src/gallium/auxiliary/vl/vl_video_buffer.c
+++ b/src/gallium/auxiliary/vl/vl_video_buffer.c
@@ -102,6 +102,8 @@ vl_video_buffer_destroy(struct pipe_video_buffer *buffer)
pipe_sampler_view_reference(&buf->sampler_view_components[i], NULL);
pipe_resource_reference(&buf->resources[i], NULL);
}
+
+ FREE(buffer);
}
static struct pipe_sampler_view **