]> git.sesse.net Git - mlt/commitdiff
plus/filter_affine.c: check for null pointer
authorMikko Rapeli <mikko.rapeli@iki.fi>
Tue, 31 Jul 2012 09:55:08 +0000 (11:55 +0200)
committerMikko Rapeli <mikko.rapeli@iki.fi>
Mon, 6 Aug 2012 16:37:27 +0000 (18:37 +0200)
Fixes Coverity CID 709402: Dereference before null check (REVERSE_INULL)
Dereferencing pointer "transition". [show details]
 64                        mlt_properties_set_int( MLT_TRANSITION_PROPERTIES( transition ), "b_alpha", 1 );
 65                }
 66
Dereferencing "transition" before a null check.
 67                if ( producer != NULL && transition != NULL )

src/modules/plus/filter_affine.c

index a0f54f68d32d888211ff29e8623c04585afdb069..35f1ce52d94f504c967905376b00a8cad98cd60a 100644 (file)
@@ -61,7 +61,8 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                {
                        transition = mlt_factory_transition( profile, "affine", NULL );
                        mlt_properties_set_data( properties, "transition", transition, 0, (mlt_destructor)mlt_transition_close, NULL );
-                       mlt_properties_set_int( MLT_TRANSITION_PROPERTIES( transition ), "b_alpha", 1 );
+                       if ( transition )
+                               mlt_properties_set_int( MLT_TRANSITION_PROPERTIES( transition ), "b_alpha", 1 );
                }
 
                if ( producer != NULL && transition != NULL )