]> git.sesse.net Git - mlt/commitdiff
videostab/filter_videostab*.c: check return value from mlt_filter_new()
authorMikko Rapeli <mikko.rapeli@iki.fi>
Wed, 1 Aug 2012 15:44:20 +0000 (17:44 +0200)
committerMikko Rapeli <mikko.rapeli@iki.fi>
Mon, 6 Aug 2012 16:37:29 +0000 (18:37 +0200)
Fixes Coverity CID 709365 and 709366:
Dereference null return value (NULL_RETURNS)
Function "mlt_filter_new" returns null (checked 50 out of 52 times). [show details]
Assigning: "parent" = null return value from "mlt_filter_new".
201                mlt_filter parent = mlt_filter_new();
Dereferencing a null pointer "parent".
202                parent->child = self;

src/modules/videostab/filter_videostab.c
src/modules/videostab/filter_videostab2.c

index 995266614665530b8aded0a8f9a250fac20d983a..947728c8b34a158aa1672e53e5d6781b5bdab812 100644 (file)
@@ -199,6 +199,8 @@ mlt_filter filter_videostab_init( mlt_profile profile, mlt_service_type type, co
        if ( self )
        {
                mlt_filter parent = mlt_filter_new();
+               if ( !parent )
+                       return NULL;
                parent->child = self;
                parent->close = filter_close;
                parent->process = filter_process;
index ce76c7d864b84d5f51c46d8552b3dfefdb54de2c..3d6df6dac2befb0cf9b6237dd4a9c31335e7a6d0 100644 (file)
@@ -246,6 +246,8 @@ mlt_filter filter_videostab2_init( mlt_profile profile, mlt_service_type type, c
        if ( data )
        {
                mlt_filter parent = mlt_filter_new();
+               if ( !parent )
+                       return NULL;
 
                parent->child = data;
                parent->close = filter_close;