From 95904cf65a449c075371637f418106d1c944d760 Mon Sep 17 00:00:00 2001 From: jureviciusr Date: Fri, 11 Jan 2019 14:56:03 +0200 Subject: [PATCH] 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 --- src/network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network.c b/src/network.c index 4eeed0a8..fc62ea79 100644 --- a/src/network.c +++ b/src/network.c @@ -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; -} \ No newline at end of file +}