7 May 19:12
Occasional crash rendering a bitmap
cecilio <s.cecilio <at> gmail.com>
2012-05-07 17:12:38 GMT
2012-05-07 17:12:38 GMT
Hi,
I'm using AGG to render documents with texts, images and music scores.
While testing rendering images, I've been experiencing occasional
crashes. Problem was finally located in file
agg_span_image_filter_rgba.h, in method [line 61]:
void generate(color_type* span, int x, int y, unsigned len)
I've found that the crashes were caused because variable 'y' was
assigned a negative value in line 67:
base_type::interpolator().coordinates(&x, &y);
I don't know the reason. It is a random issue. In a loop of
re-rendering the same bitmap, it will run 15 to 20 times OK before
crashing. So I tried to by-pass the problem by adding the following
lines [new lines 68 & 69]
if (y < 0) y = 0; //CSG. 7/May/2012. Bug by-pass.
if (x < 0) x = 0; //CSG. 7/May/2012. Bug by-pass.
Now, everything seems to work OK and I have no longer experienced any
problem. Also, I have not noticed any 'glitch' in the drawings.due to
this hack.
I'm just posting this just in case anyone is interested, although it
is probably a bug in my code due to not properly using AGG.
Best regards,
Cecilio
------------------------------------------------------------------------------
(Continue reading)
RSS Feed