Access Violation (Read) with DrawableRoundRectangle

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
imcz

Access Violation (Read) with DrawableRoundRectangle

Post by imcz »

Hi,

I do get an access violation with drawing a DrawableRoundRectangle and certain parameter (creating the Drawable-class itself does work just fine).
I am using ImageMagick 6.5.2-Q8 on Vista 64.
I am using Magic++ with Visual Studio 2003.

here is some code which does demonstrate the issue:

Code: Select all

//Image dimension, used also for the rounded rectangle
int nWidth = 1944, nHeight = 2592;
//Initial corner dimensions
double fHorizCR = 555, fVertCR = 649;

Geometry geometry;
geometry.width(nWidth);
geometry.height(nHeight);
geometry.xOff(0);
geometry.yOff(0);

Image image(geometry,Color("white"));
image.strokeWidth(0);
image.fillColor("black");

//This does work
image.draw(DrawableRoundRectangle(0,0,nWidth,nHeight,fHorizCR,fVertCR));

//Now increase the corner dimensions slightly
fHorizCR = 557.7;
fVertCR = 651.2;

//This fails with an access violation
image.draw(DrawableRoundRectangle(0,0,nWidth,nHeight,fHorizCR,fVertCR));
The first draw call does work, the second does not, I don't see really why.
Interestingly, when I changed the image (and rectangle dimensions) to 194x259, it does work for both, when I increase the size, it will still fail.
Is there some kind of limit I am reaching?
It also doesn't seem to be related to the factor between rectangle dimensions and corner dimensions, but actually with the absolute values as far as I can tell.

Is there a limit I am not aware of? (Because then I can build in a check)
Or is there a bug within the draw method.
Any help is highly appreciated.

Thanks

Michael
imcz

Re: Access Violation (Read) with DrawableRoundRectangle

Post by imcz »

Sorry to push this, but I am wondering why no one is commenting.
Am I in the wrong forum or section?
Or did I forgot any information to add?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Access Violation (Read) with DrawableRoundRectangle

Post by magick »

We can reproduce the problem you posted and have a patch. Look for it in the next ImageMagick point release within a day or two. Thanks.
imcz

Re: Access Violation (Read) with DrawableRoundRectangle

Post by imcz »

Thank you very much
Post Reply