]> git.sesse.net Git - mlt/commitdiff
fix possible null pointer with strdup()
authorDan Dennedy <dan@dennedy.org>
Sun, 19 Aug 2012 20:24:30 +0000 (13:24 -0700)
committerDan Dennedy <dan@dennedy.org>
Sun, 19 Aug 2012 20:24:30 +0000 (13:24 -0700)
src/modules/xml/consumer_xml.c

index 883ee7de32f49f39147fc882f15748b188fa2fd9..0b308e0c1919aba6be170e8df715e334ad67432a 100644 (file)
@@ -235,8 +235,14 @@ static void serialise_properties( serialise_context context, mlt_properties prop
                         strcmp( name, "height" ) )
                {
                        char *value;
+                       fprintf(stderr, "serializing %s=%s (%d)\n", name, mlt_properties_get( properties, name ),
+                                       context->time_format);
                        if ( !strcmp( name, "length" ) )
-                               value = strdup( mlt_properties_get_time( properties, name, context->time_format ) );
+                       {
+                               char *time = mlt_properties_get_time( properties, name, context->time_format );
+                               if ( time )
+                                       value = strdup( time );
+                       }
                        else
                                value = filter_restricted( mlt_properties_get_value( properties, i ) );
                        if ( value )