Segfault on trying to fill NDArray in C++

Hi. I’m trying to repeat DeployGraphExecutor from this example

I loaded my exported lib and changed these ndarrays:

// Use the C++ API
tvm::runtime::NDArray x = tvm::runtime::NDArray::Empty({2, 2}, DLDataType{kDLFloat, 32, 1}, dev);
tvm::runtime::NDArray y = tvm::runtime::NDArray::Empty({2, 2}, DLDataType{kDLFloat, 32, 1}, dev);

To this:

tvm::runtime::NDArray x = tvm::runtime::NDArray::Empty({3, 224, 224}, DLDataType{kDLFloat, 32, 1}, dev);
tvm::runtime::NDArray y = tvm::runtime::NDArray::Empty({264, 224, 224}, DLDataType{kDLFloat, 32, 1}, dev);

And when I try to do:

for (int c = 0; c < 3; ++c) {
for (int i = 0; i < 224; ++i) {
for (int j = 0; j < 224; ++j) {
static_cast<float*>(x->data)[c * 224 * 224 + i * 224 + j] = 1;
}
}
}

It falls with segmentation fault. I tryed to debug it. It falls when c=0, i=48 and j=73. Each time. What am I doing wrong?