summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vdpau/output.c
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2011-07-11 16:29:02 +0200
committerChristian König <deathsimple@vodafone.de>2011-07-11 16:29:02 +0200
commitdf5e0b9435c869f88234a69db9bfe97342b027d4 (patch)
treedba46740cec2d3da73fd6d9522af7d2b770162c0 /src/gallium/state_trackers/vdpau/output.c
parenta7ec477ebc8b256381854f1cef0ec03a2d713555 (diff)
downloadexternal_mesa3d-df5e0b9435c869f88234a69db9bfe97342b027d4.zip
external_mesa3d-df5e0b9435c869f88234a69db9bfe97342b027d4.tar.gz
external_mesa3d-df5e0b9435c869f88234a69db9bfe97342b027d4.tar.bz2
[g3dvl] fix a whole bunch of memory leaks
Diffstat (limited to 'src/gallium/state_trackers/vdpau/output.c')
-rw-r--r--src/gallium/state_trackers/vdpau/output.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/vdpau/output.c b/src/gallium/state_trackers/vdpau/output.c
index f67d6cc..bc4b39a 100644
--- a/src/gallium/state_trackers/vdpau/output.c
+++ b/src/gallium/state_trackers/vdpau/output.c
@@ -88,6 +88,7 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
vlsurface->sampler_view = pipe->create_sampler_view(pipe, res, &sv_templ);
if (!vlsurface->sampler_view) {
+ pipe_resource_reference(&res, NULL);
FREE(dev);
return VDP_STATUS_ERROR;
}
@@ -97,15 +98,19 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
surf_templ.usage = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
vlsurface->surface = pipe->create_surface(pipe, res, &surf_templ);
if (!vlsurface->surface) {
+ pipe_resource_reference(&res, NULL);
FREE(dev);
return VDP_STATUS_ERROR;
}
*surface = vlAddDataHTAB(vlsurface);
if (*surface == 0) {
+ pipe_resource_reference(&res, NULL);
FREE(dev);
return VDP_STATUS_ERROR;
}
+
+ pipe_resource_reference(&res, NULL);
return VDP_STATUS_OK;
}