Hi.

Working on Kdenlive's clip properties dialog, I noticed a reproducible crash 
when forcing a clip's aspect ratio and then resetting it to default.

In Kdenlive, when we want to reset a property, we use for example:

producer->set("force_aspect_ratio", (const char*) NULL);

Is there a better way to remove a property?

If not, the patch below fixes the crash.

regards
jb



index 6763dba..951ff51 100644
--- a/src/modules/avformat/producer_avformat.c
+++ b/src/modules/avformat/producer_avformat.c
@@ -1663,7 +1663,11 @@ static void producer_set_up_video( producer_avformat 
this, mlt_frame frame )
        if ( context && index > -1 && video_codec_init( this, index, 
properties ) )
        {
                // Set the frame properties
-               double force_aspect_ratio = mlt_properties_get_double( 
properties, "force_aspect_ratio" );
+               double force_aspect_ratio = 0.0;
+               if ( mlt_properties_get( properties, "force_aspect_ratio" ) )
+               {
+                       force_aspect_ratio = mlt_properties_get_double( 
properties, "force_aspect_ratio" );
+               }
                double aspect_ratio = ( force_aspect_ratio > 0.0 ) ?
                        force_aspect_ratio : mlt_properties_get_double( 
properties, "aspect_ratio" );

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Mlt-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to