From c53abe751e8a3d968a6adb3efabcc26fda323595 Mon Sep 17 00:00:00 2001 From: ddennedy Date: Sat, 27 Dec 2008 05:50:42 +0000 Subject: [PATCH] transition_luma.c: bugfix (kdenlive-496) floating point exception when a slideshow using filter luma is added to a multitrack. git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1290 d19143bc-622f-0410-bfdd-b5b2a6649095 --- src/modules/core/transition_luma.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/core/transition_luma.c b/src/modules/core/transition_luma.c index 258eefa..f08d84f 100644 --- a/src/modules/core/transition_luma.c +++ b/src/modules/core/transition_luma.c @@ -146,6 +146,9 @@ static void luma_composite( mlt_frame a_frame, mlt_frame b_frame, int luma_width mlt_frame_get_image( a_frame, &p_dest, &format_dest, &width_dest, &height_dest, 1 ); mlt_frame_get_image( b_frame, &p_src, &format_src, &width_src, &height_src, 0 ); + if ( *width == 0 || *height == 0 ) + return; + // Pick the lesser of two evils ;-) width_src = width_src > width_dest ? width_dest : width_src; height_src = height_src > height_dest ? height_dest : height_src; @@ -527,7 +530,6 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f if ( mlt_properties_get( properties, "fixed" ) ) mix = mlt_properties_get_double( properties, "fixed" ); - if ( luma_width > 0 && luma_height > 0 && luma_bitmap != NULL ) // Composite the frames using a luma map luma_composite( !invert ? a_frame : b_frame, !invert ? b_frame : a_frame, luma_width, luma_height, luma_bitmap, mix, frame_delta, @@ -536,7 +538,6 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f // Dissolve the frames using the time offset for mix value dissolve_yuv( a_frame, b_frame, mix, *width, *height ); - // Extract the a_frame image info *width = mlt_properties_get_int( !invert ? a_props : b_props, "width" ); *height = mlt_properties_get_int( !invert ? a_props : b_props, "height" ); -- 1.7.4.4