[vlc-devel] [RFC PATCH 07/11] omxil: factorize FreeBuffers and AllocateBuffers
Martin Storsjö
martin at martin.st
Tue Jun 24 21:43:19 CEST 2014
On Tue, 24 Jun 2014, Thomas Guillem wrote:
> ---
> modules/codec/omxil/omxil.c | 236 ++++++++++++++++++++++---------------------
> 1 file changed, 123 insertions(+), 113 deletions(-)
>
> diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
> index df75c93..c1ed20d 100644
> --- a/modules/codec/omxil/omxil.c
> +++ b/modules/codec/omxil/omxil.c
> @@ -580,7 +663,8 @@ static OMX_ERRORTYPE DeinitialiseComponent(decoder_t *p_dec,
> for(i = 0; i < p_sys->ports; i++)
> {
> OmxPort *p_port = &p_sys->p_ports[i];
> - free(p_port->pp_buffers);
> + if( p_port->pp_buffers )
> + free(p_port->pp_buffers);
> p_port->pp_buffers = 0;
> }
> omx_error = pf_free_handle( omx_handle );
I forgot to point this out before - this isn't necessary, free(NULL) is
always ok.
// Martin
More information about the vlc-devel
mailing list