mirror of
https://github.com/opencv/opencv.git
synced 2025-07-24 14:06:27 +08:00
dnn: fix sporadic crashes in getUMat()
Incorrect "total" buffer size calculated in StdMatAllocator::allocate() due wrong step values.
This commit is contained in:
parent
21c8e6d02d
commit
436a1f72a5
@ -692,8 +692,11 @@ void TFImporter::populateNet(Net dstNet)
|
||||
int dst_i = (j * chMultiplier + i) * height* width + s;
|
||||
dst[dst_i] = src[src_i];
|
||||
}
|
||||
// TODO Use reshape instead
|
||||
kshape[0] = inCh * chMultiplier;
|
||||
kshape[1] = 1;
|
||||
size_t* kstep = layerParams.blobs[0].step.p;
|
||||
kstep[0] = kstep[1]; // fix steps too
|
||||
}
|
||||
layerParams.set("kernel_h", kshape[2]);
|
||||
layerParams.set("kernel_w", kshape[3]);
|
||||
|
Loading…
Reference in New Issue
Block a user