Что означает эта ошибка?
==4304== 11 errors in context 3 of 18:
==4304== Invalid write of size 1
==4304== at 0x401A68: main (colors.c:86)
==4304== Address 0x5c191c0 is 0 bytes after a block of size 786,432 alloc'd
==4304== at 0x4C244E8: malloc (vg_replace_malloc.c:236)
==4304== by 0x401E00: TImage::Create(int, int, unsigned char) (mypic.h:66)
==4304== by 0x401741: main (colors.c:48)
class TImage {
public:
U08 *pBuf;
S32 w,h;
U08 planes;
U32 stride;
....
void Create (S32 w_new, S32 h_new, U08 planes_new) {
w = w_new;
h = h_new;
planes = planes_new;
stride = planes * w;
pBuf = (U08 *)malloc (stride * h); <--- вот на эту строчку ругается, mypic.h:66
memset (pBuf, 0x00, stride * h);
}
....
}