Commit 3223bb48 authored by Antoine Cellerier's avatar Antoine Cellerier

Check for NULL pointer before using it, not after.

parent deef7f86
...@@ -221,13 +221,13 @@ static picture_t *Chain( filter_t *p_filter, picture_t *p_pic ) ...@@ -221,13 +221,13 @@ static picture_t *Chain( filter_t *p_filter, picture_t *p_pic )
if( !p_sys->p_tmp ) if( !p_sys->p_tmp )
{ {
picture_t *p_tmp = malloc( sizeof( picture_t ) ); picture_t *p_tmp = malloc( sizeof( picture_t ) );
if( !p_tmp )
return NULL;
vout_AllocatePicture( VLC_OBJECT( p_vout ), p_tmp, vout_AllocatePicture( VLC_OBJECT( p_vout ), p_tmp,
p_sys->fmt_mid.i_chroma, p_sys->fmt_mid.i_chroma,
p_sys->fmt_mid.i_width, p_sys->fmt_mid.i_width,
p_sys->fmt_mid.i_height, p_sys->fmt_mid.i_height,
p_sys->fmt_mid.i_aspect ); p_sys->fmt_mid.i_aspect );
if( !p_tmp )
return NULL;
p_sys->p_tmp = p_tmp; p_sys->p_tmp = p_tmp;
p_tmp->pf_release = NULL; p_tmp->pf_release = NULL;
p_tmp->i_status = RESERVED_PICTURE; p_tmp->i_status = RESERVED_PICTURE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment