Commit 38f90a60 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Merge branch 'develop' into feature/evaluation

parents 70a5a412 251267f9
......@@ -162,6 +162,8 @@ void PrrtBlock_encode(PrrtBlock *block_ptr, uint16_t *seqno)
void PrrtBlock_decode(PrrtBlock *block_ptr)
{
int i, j = 0;
gf **fec = NULL;
int *idx_p = NULL;
uint8_t n = block_ptr->codingParams.n;
uint8_t k = block_ptr->codingParams.k;
......@@ -171,13 +173,13 @@ void PrrtBlock_decode(PrrtBlock *block_ptr)
PrrtCoder_get_coder(&coder, n, k);
gf **fec = calloc(n, sizeof(gf *));
fec = calloc(n, sizeof(gf *));
check_mem(fec);
for(i = 0; i < n; i++) {
fec[i] = calloc(block_ptr->largestDataLength, sizeof(gf));
}
int *idx_p = calloc(k, sizeof(int));
idx_p = calloc(k, sizeof(int));
check_mem(idx_p);
gather_redundancy_packets(block_ptr, fec, idx_p);
......@@ -194,8 +196,12 @@ void PrrtBlock_decode(PrrtBlock *block_ptr)
PrrtCoder_destroy(coder);
clear_list(fec, n);
free(fec);
free(idx_p);
if(fec != NULL) {
free(fec);
}
if(idx_p != NULL) {
free(idx_p);
}
}
PrrtPacket *PrrtBlock_get_first_red_data(PrrtBlock *block_ptr)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment