Browse Source

opencv: check the image conversion worked

Otherwise we release the output picture that would have been used and returned.
pull/165/head
Steve Lhomme 2 years ago
parent
commit
19813291fc
  1. 13
      modules/video_filter/opencv_wrapper.c

13
modules/video_filter/opencv_wrapper.c

@ -434,9 +434,16 @@ static picture_t* Filter( filter_t* p_filter, picture_t* p_pic )
p_sys->p_proc_image,
&(p_sys->p_proc_image->format),
&fmt_out );
picture_CopyPixels( p_outpic, p_outpic_tmp );
CopyInfoAndRelease( p_outpic, p_outpic_tmp );
if (unlikely(!p_outpic_tmp))
{
picture_Release(p_outpic);
p_outpic = NULL;
}
else
{
picture_CopyPixels( p_outpic, p_outpic_tmp );
CopyInfoAndRelease( p_outpic, p_outpic_tmp );
}
} else if( p_sys->i_internal_chroma == CINPUT ) {
picture_CopyPixels( p_outpic, p_sys->p_proc_image );
picture_CopyProperties( p_outpic, p_sys->p_proc_image );

Loading…
Cancel
Save