The "YoloRT" class should allocate memory for the "mask" menber in the constructor.
YourRT(...... int n_masks ......)
{
mask = new dnnType[n_masks];
}
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am trying to copy some buffers i read from buffer to variables in a class,
const char * buf = reinterpret_cast<const char*>(serialData);//buffer
Initializing the constructor
YoloRT *r = new YoloRT(readBUF<int>(buf), //classes
readBUF<int>(buf), //num
nullptr, //yolo
readBUF<int>(buf), //n_masks
readBUF<float>(buf), //scale_xy
readBUF<float>(buf), //nms_thresh
readBUF<int>(buf), //nms_kind
readBUF<int>(buf) //new_coords
);
for (int i = 0; i < r->n_masks; i++)
{
r->mask[i] = readBUF<dnnType>(buf);//error line
}
The error pop ups at the line mentioned, When I debug it, the error statement reads and points at buf and the value of "i" at which this error occurs changes everytime I debug it. I am confused as to what is happening here as the same code works perfectly fine on linux.It would be amazing if someone can explain why this is happening only in windows(MSVC toolchain) and any workarounds for it?
The "YoloRT" class should allocate memory for the "mask" menber in the constructor.
YourRT(...... int n_masks ......)
{
mask = new dnnType[n_masks];
}