// We should resize the alpha too
uint8_t *alpha = mlt_frame_get_alpha_mask( this );
- if ( alpha != NULL )
+ int alpha_size = 0;
+ mlt_properties_get_data( properties, "alpha", &alpha_size );
+ if ( alpha && alpha_size >= ( *width * *height ) )
{
uint8_t *newalpha = mlt_pool_alloc( owidth * oheight );
if ( newalpha )
// Get the input image, width and height
uint8_t *input = mlt_properties_get_data( properties, "image", NULL );
uint8_t *alpha = mlt_frame_get_alpha_mask( this );
+ int alpha_size = 0;
+ mlt_properties_get_data( properties, "alpha", &alpha_size );
int iwidth = mlt_properties_get_int( properties, "width" );
int iheight = mlt_properties_get_int( properties, "height" );
mlt_properties_set_int( properties, "height", oheight );
// We should resize the alpha too
- alpha = resize_alpha( alpha, owidth, oheight, iwidth, iheight, alpha_value );
- if ( alpha != NULL )
+ if ( alpha && alpha_size >= iwidth * iheight )
{
- mlt_properties_set_data( properties, "alpha", alpha, owidth * oheight, ( mlt_destructor )mlt_pool_release, NULL );
- this->get_alpha_mask = NULL;
+ alpha = resize_alpha( alpha, owidth, oheight, iwidth, iheight, alpha_value );
+ if ( alpha )
+ {
+ mlt_properties_set_data( properties, "alpha", alpha, owidth * oheight, ( mlt_destructor )mlt_pool_release, NULL );
+ this->get_alpha_mask = NULL;
+ }
}
// Return the output