I've posted this query on the User forum, but so far no luck, so hopefully a developer can help...
I'm just using Magick++ to convert an in memory Jpeg2000 image to a bitmap. The conversion functions correctly, but when the method returns, VisualStudio throws a debug assertion stating an invalid address specified for RtlValidateHeap(). Looking at the call trace, this occurs inside the CORE_DB_Magick++_.dll when calling the delete operator on the Magick::Image object.
The code I'm using is pretty simple, and is below.
Code: Select all
void imageproc( void* pdata, size_t size )
{
Image image;
Blob in_b, out_b;
// initialise magick
Initializemagick( NULL );
// assign data to a blob
in_b.updateNoCopy( pdata, size );
// read the bloc data into an image object, set the new format, and write to the output blob
try {
image.read( in_b );
image.magick( "bmp" );
image.write( &out_b );
}
catch( Error& error ) {
...
return;
}
}
Code: Select all
void imageproc( void* pdata, size_t size )
{
Image* image = new Image;
Blob in_b, out_b;
// initialise magick
Initializemagick( NULL );
// assign data to a blob
in_b.updateNoCopy( pdata, size );
// read the bloc data into an image object, set the new format, and write to the output blob
try {
image->read( in_b );
image->magick( "bmp" );
image->write( &out_b );
}
catch( Error& error ) {
...
return;
}
// clearup
delete image; - this causes windows to trigger a breakpoint
}
Thanks for any help you can give,
Regards
Rob Smith