Bad memory allocation

the variable [network->seen is declared uint64_t* ](https://github.com/AlexeyAB/darknet/blob/master/include/darknet.h#L519), but constructing function allocates only 4 bytes for (int) here
This commit is contained in:
jureviciusr
2019-01-11 14:56:03 +02:00
committed by GitHub
parent 041cffd9b8
commit 95904cf65a

View File

@ -179,7 +179,7 @@ network make_network(int n)
network net = {0};
net.n = n;
net.layers = calloc(net.n, sizeof(layer));
net.seen = calloc(1, sizeof(int));
net.seen = calloc(1, sizeof(uint64_t));
#ifdef GPU
net.input_gpu = calloc(1, sizeof(float *));
net.truth_gpu = calloc(1, sizeof(float *));
@ -969,4 +969,4 @@ network combine_train_valid_networks(network net_train, network net_map)
}
}
return net_combined;
}
}