]> git.sesse.net Git - mlt/blobdiff - src/modules/xml/producer_xml.c
Fix calloc() parameter ordering
[mlt] / src / modules / xml / producer_xml.c
index c2d41b2cb69c0c4596f30e6326bd9d18364785ab..646d6a2c01a546b4e81c4f9176e1a9a90bda75c6 100644 (file)
@@ -1301,7 +1301,7 @@ static void on_characters( void *ctx, const xmlChar *ch, int len )
 {
        struct _xmlParserCtxt *xmlcontext = ( struct _xmlParserCtxt* )ctx;
        deserialise_context context = ( deserialise_context )( xmlcontext->_private );
-       char *value = calloc( len + 1, 1 );
+       char *value = calloc( 1, len + 1 );
        enum service_type type;
        mlt_service service = context_pop_service( context, &type );
        mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
@@ -1324,7 +1324,7 @@ static void on_characters( void *ctx, const xmlChar *ch, int len )
                if ( s != NULL )
                {
                        // Append new text to existing content
-                       char *new = calloc( strlen( s ) + len + 1, 1 );
+                       char *new = calloc( 1, strlen( s ) + len + 1 );
                        strcat( new, s );
                        strcat( new, value );
                        mlt_properties_set( properties, context->property, new );