You're doing pointer manipulation on pointers to dynamically allocated memory. This has a couple of effects:
- you're orphaning blocks of memory - you couldn't free R1, even if you wanted to
- as Albert said you're overrunning an array somewhere. You're not assigning xa anywhere for one thing so it's left with whatever was in that memory location before it was reallocated to hold your variable
So, what can you do about this lot?
- use std::vector instead of fiddling about with dynamic memory. This will sort your memory leaks out, cause even if you assign them. This includes the input parameters - use a const reference for Source and a reference for Result. This also includes the parts of GPA that are arrays (if they're not just arrays of arrays of points)
- Lean on the runtime library. If you're using VC++ in debug mode you'll get some sort of assert of exception if you run over the bounds of a vector. If you don't there might be a way to turn on bounds checking for your compiler. If there isn't do a assert that array indices are valid. Some compilers do iterator bounds checking so perhaps use iterators rather than the  operator - it'll make your code a bit uglier but easier for the runtime library to catch errors
Some other comments...
- don't use redundant variables where you don't need to, e.g. xa and ya aren't assigned to. xa1 and sy1 are just aliases for xa + 1, sy +1, T1 for T + 1 xe and s for Source->X and ye for Source->Y. sy is always zero during your first two loops. sx starts at 0 the first two loops
- always initialise variables
- if you have to cast use C++ casts. If you find you're
ing all over the shop there is something wrong with what you're doing
- use a->b rather than (*a).b. It's a character less and is a bit more obvious to jaded old hacks like me
- why's Gaus a class? Looks like a function to me. There's no state and the constructors/destructors don't do anything. It can't even be used as a functor as it doesn't have an overloaded operator()
- where's T declared?? Don't use global variables! Ever. For anything
- Look at the lines R1=R2; R2=R3. First iteration R1 = R2(intial) and R2=R3(initial). Second and subsequent iterations R1=R3(initial) and R2=R3(intial). Are you sure you want that?
same sort of comment for int r1=r2; int G1=G2; int B1=B2; r2=r3; G2=G3; B2=B3;
- scratch that, was too tired to see r3, G3 and B3 were modified later in the same iteration
- don't use declare loop variables at a larger scope than they need to be. All of yours are.
- don't declare variables until you need them. P for instance has way too much scope and looks like it could do with a three parameter constructor
- Source and Result's declarations look a bit suspect to me - especially as *Source and *Result are 2D arrays.
- are you sure you need P? If I'm reading right a three term constructor would be enough and where you pass &P into WriteSecure a const reference will do
Get rid of that lot and it wouldn't surprise me if the error became glaringly obvious!
Jesus, spent 3 hours reviewing that lot - you owe me £150 at my usual training contract rate. £75 for students. Where do I send the invoice?