mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
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:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user