int c_Image::draw( IMAGE *dest, IMAGE *source, int x, int y )
{
unsigned short *src, *dst;
unsigned short t, u, v, a;
src = source->c;
dst = dest->c;
for( int i = 0; i < source->h; i++, dst += dest->w )
for( int j = 0; j < source->w; j++, src++ )
{
t = *src;
>> crashes here >> dst[j] = t;
}
return 0;
} // int c_Image::draw( IMAGE *dest, IMAGE *source, int x, int y )
It crashes where marked. but if i replace t with a constant or another variable, it doesn''t crash.
OneEyeLessThanNone
Am i missing something here?
I can compile the following code but when I execute it kicks out. I''m guessing it''s a page fault but it doesn''t even give me any error windows so I can''t verify. The debugger seems to crash when ever i use it so thats useless.
Am I missing something in this code or what?
I think that you''re running over the array''s boundaries. Try dst[j - 1] = t; and see if it works.
/. Muzzafarath
Mad House Software
/. Muzzafarath
Mad House Software
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement