static void luma_read_pgm( FILE *f, float **map, int *width, int *height )
{
+ void *release = NULL;
uint8_t *data = NULL;
while (1)
{
bpp = maxval > 255 ? 2 : 1;
// allocate temporary storage for the raw data
- // IRRIGATE ME
- data = malloc( *width * *height * bpp );
+ data = mlt_pool_allocate( *width * *height * bpp, &release );
if ( data == NULL )
break;
// allocate the luma bitmap
// IRRIGATE ME
+ // Difficult here - need to change the function prototype....
*map = p = (float*) malloc( *width * *height * sizeof( float ) );
if ( *map == NULL )
break;
break;
}
- if ( data != NULL )
- free( data );
+ if ( release != NULL )
+ mlt_pool_release( release );
}