PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Debugging: My code passed correct values, PF don't get them

I have a strange bug now that I have my code running on WM2005. All small test programs work. My game crashes always on Blits and by debugging I have found that when my function calls Blit or Blitstretch the correct values for surface buffer etc but the function fails on a first chance exception data error. It's in rasterizer.cpp that it goes wrong, followed it down into algo2d.h and it's the line
Code:
Pixel* dest = buffer.GetPixels( x1 >> 6, dy >> 6 );
which leads to surface.h
Code:
uint16_t* GetPixels( int x, int y ) { return (uint16_t*)((char*)(m_pixels + x) + y * m_pitch); } ///< Retrieve a pointer to the pixels.
where the m_pixels is highlighted as a bad pointer ???

Any clues, advice or complete worked solutions are welcome