windows Heap problems using Magick++
Posted: 2010-07-13T05:56:17-07:00
Hello,
I'm just using Magick++ to convert an in memory Jpeg2000 image to a bitmap. The conversion functions correctly, but when the method returns, VStudio 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.
The code I'm using is pretty simple, and is below.
The code above is simplified, but should work. It works fine in terms of correctly putting a bitmap image into the output blob, but then causing a heap error when the function returns. Is there any cleanup i should be doing with the image object?
Thanks for any help,
Rob Smith
I'm just using Magick++ to convert an in memory Jpeg2000 image to a bitmap. The conversion functions correctly, but when the method returns, VStudio 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.
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;
}
}
Thanks for any help,
Rob Smith