static int producer_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable )
{
uint8_t *data = NULL;
+ int size = 0;
mlt_properties properties = MLT_FRAME_PROPERTIES( this );
mlt_frame frame = mlt_frame_pop_service( this );
mlt_properties frame_properties = MLT_FRAME_PROPERTIES( frame );
mlt_properties_set_int( properties, "progressive", mlt_properties_get_int( frame_properties, "progressive" ) );
mlt_properties_set_int( properties, "distort", mlt_properties_get_int( frame_properties, "distort" ) );
data = mlt_frame_get_alpha_mask( frame );
- mlt_properties_set_data( properties, "alpha", data, 0, NULL, NULL );
+ mlt_properties_get_data( frame_properties, "alpha", &size );
+ mlt_properties_set_data( properties, "alpha", data, size, NULL, NULL );
return 0;
}
if ( output_format == mlt_image_rgb24a || output_format == mlt_image_opengl )
{
register int len = width * height;
+ int alpha_size = 0;
uint8_t *alpha = mlt_frame_get_alpha_mask( frame );
+ mlt_properties_get_data( properties, "alpha", &alpha_size );
- if ( alpha )
+ if ( alpha && alpha_size >= len )
{
// Merge the alpha mask from into the RGBA image using Duff's Device
register uint8_t *s = alpha;