On Sat, Jan 28, 2012 at 9:20 AM, j-b-m <[email protected]> wrote:
> Hi.
>
> Since the recent changes to the xml consumer, lots of crashes were reported in
> Kdenlive. I traced it down to a problem in a free, see my attached patch that
> fixes the issue.
>
applied with a little formatting and comment
> regards,
>
> jb
>
> diff --git a/src/modules/xml/consumer_xml.c b/src/modules/xml/consumer_xml.c
> index 2b0f6bc..5f10f59 100644
> --- a/src/modules/xml/consumer_xml.c
> +++ b/src/modules/xml/consumer_xml.c
> @@ -60,7 +60,7 @@ static int consumer_is_stopped( mlt_consumer this );
> static void *consumer_thread( void *arg );
> static void serialise_service( serialise_context context, mlt_service
> service, xmlNode *node );
>
> -static void* filter_restricted( const char *in )
> +static char* filter_restricted( const char *in )
> {
> if ( !in ) return NULL;
> size_t n = strlen( in );
> @@ -235,9 +235,10 @@ static void serialise_properties( serialise_context
> context, mlt_properties prop
> if ( value )
> {
> int rootlen = strlen( context->root );
> - if ( rootlen && !strncmp( value,
> context->root, rootlen ) && value[
> rootlen ] == '/' )
> - value += rootlen + 1;
> - p = xmlNewTextChild( node, NULL,
> _x("property"), _x(value) );
> + if ( rootlen && !strncmp( value,
> context->root, rootlen ) && value[
> rootlen ] == '/' ) {
> + p = xmlNewTextChild( node, NULL,
> _x("property"), _x(value + rootlen
> + 1 ) );
> + }
> + else p = xmlNewTextChild( node, NULL,
> _x("property"), _x(value) );
> xmlNewProp( p, _x("name"), _x(name) );
> free( value );
> }
> @@ -261,8 +262,13 @@ static void serialise_store_properties( serialise_context
> context, mlt_propertie
> {
> int rootlen = strlen( context->root );
> if ( rootlen && !strncmp( value,
> context->root, rootlen ) && value[
> rootlen ] == '/' )
> - value += rootlen + 1;
> - p = xmlNewTextChild( node, NULL,
> _x("property"), _x(value) );
> + {
> + p = xmlNewTextChild( node, NULL,
> _x("property"), _x(value + rootlen
> + 1) );
> + }
> + else
> + {
> + p = xmlNewTextChild( node, NULL,
> _x("property"), _x(value) );
> + }
> xmlNewProp( p, _x("name"), _x(name) );
> free( value );
> }
--
+-DRD-+
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Mlt-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mlt-devel