I've developed a small program in .NET which uses pf for the graphics. I am experiencing some strange crashes that I cannot explain.
By writing log messages to a file I've tracked the crash to the function Algo2D::BlitMask in the loop:
I've checked that both source and destination surface are valid and that the srcRect is within the source surface. I've also made sure that the clipping code in Rasterizer::Blit (which is the caller function) is ran.
The really strange thing is that sometimes the crash occurs in Algo2D::BlitMask and sometimes in Raster2D::Blit. Another strange thing is that the crash does not happen the first time the function is called with those exact arguments but the 50. time or so.
I am at a loss here so any help would be appreciated.
By writing log messages to a file I've tracked the crash to the function Algo2D::BlitMask in the loop:
- Code:
for ( int h = srcRect.GetHeight(); h; --h )
{
transform_if( pSrc, pSrc + width, pDest, pDest, bind2nd( not_equal_to<Pixel>(), mask ), F );
pSrc = (Pixel*)((uint8_t*)pSrc + source.GetPitch());
pDest = (Pixel*)((uint8_t*)pDest + buffer.GetPitch());
}
I've checked that both source and destination surface are valid and that the srcRect is within the source surface. I've also made sure that the clipping code in Rasterizer::Blit (which is the caller function) is ran.
The really strange thing is that sometimes the crash occurs in Algo2D::BlitMask and sometimes in Raster2D::Blit. Another strange thing is that the crash does not happen the first time the function is called with those exact arguments but the 50. time or so.
I am at a loss here so any help would be appreciated.