Fixes Coverity CID 709405: Dereference before null check (REVERSE_INULL)
Directly dereferencing pointer "data".
244 data->stab = calloc( 1, sizeof(StabData) );
245 data->trans = calloc( 1, sizeof (TransformData) ) ;
Dereferencing "data" before a null check.
246 if ( data )
mlt_filter filter_videostab2_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
videostab2_data* data= calloc( 1, sizeof(videostab2_data));
- data->stab = calloc( 1, sizeof(StabData) );
- data->trans = calloc( 1, sizeof (TransformData) ) ;
if ( data )
{
+ data->stab = calloc( 1, sizeof(StabData) );
+ if ( !data->stab )
+ {
+ free( data );
+ return NULL;
+ }
+
+ data->trans = calloc( 1, sizeof (TransformData) ) ;
+ if ( !data->trans )
+ {
+ free( data->stab );
+ free( data );
+ return NULL;
+ }
+
mlt_filter parent = mlt_filter_new();
if ( !parent )
return NULL;