summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorChristian König <[email protected]>2014-03-01 13:25:58 +0100
committerChristian König <[email protected]>2014-03-07 08:55:57 +0100
commit53d1d879d533db55eed806343f4de28e5d0ae49b (patch)
tree0c7c6159a1b0c4f4103b443c5aec951c371fcc39 /src/gallium/state_trackers
parent378c6f2246d66254ce0f88cac6daf25b1c012a41 (diff)
st/omx/enc: fix crash on destruction
Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/omx/vid_enc.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/gallium/state_trackers/omx/vid_enc.c b/src/gallium/state_trackers/omx/vid_enc.c
index 993ff5739b7..cd4a25b753b 100644
--- a/src/gallium/state_trackers/omx/vid_enc.c
+++ b/src/gallium/state_trackers/omx/vid_enc.c
@@ -182,14 +182,21 @@ static OMX_ERRORTYPE vid_enc_Constructor(OMX_COMPONENTTYPE *comp, OMX_STRING nam
if (!priv->s_pipe)
return OMX_ErrorInsufficientResources;
- priv->t_pipe = screen->context_create(screen, priv->screen);
- if (!priv->t_pipe)
+ if (!vl_compositor_init(&priv->compositor, priv->s_pipe)) {
+ priv->s_pipe->destroy(priv->s_pipe);
+ priv->s_pipe = NULL;
return OMX_ErrorInsufficientResources;
+ }
- if (!vl_compositor_init(&priv->compositor, priv->s_pipe))
+ if (!vl_compositor_init_state(&priv->cstate, priv->s_pipe)) {
+ vl_compositor_cleanup(&priv->compositor);
+ priv->s_pipe->destroy(priv->s_pipe);
+ priv->s_pipe = NULL;
return OMX_ErrorInsufficientResources;
+ }
- if (!vl_compositor_init_state(&priv->cstate, priv->s_pipe))
+ priv->t_pipe = screen->context_create(screen, priv->screen);
+ if (!priv->t_pipe)
return OMX_ErrorInsufficientResources;
priv->sPortTypesParam[OMX_PortDomainVideo].nStartPortNumber = 0;
@@ -259,15 +266,15 @@ static OMX_ERRORTYPE vid_enc_Destructor(OMX_COMPONENTTYPE *comp)
priv->ports=NULL;
}
- vl_compositor_cleanup_state(&priv->cstate);
- vl_compositor_cleanup(&priv->compositor);
-
for (i = 0; i < OMX_VID_ENC_NUM_SCALING_BUFFERS; ++i)
if (priv->scale_buffer[i])
priv->scale_buffer[i]->destroy(priv->scale_buffer[i]);
- if (priv->s_pipe)
+ if (priv->s_pipe) {
+ vl_compositor_cleanup_state(&priv->cstate);
+ vl_compositor_cleanup(&priv->compositor);
priv->s_pipe->destroy(priv->s_pipe);
+ }
if (priv->t_pipe)
priv->t_pipe->destroy(priv->t_pipe);