Commit f5c472ff by Celine Mercier

C: fixed a memory bug in the array indexer

parent 580db2f7
......@@ -35,7 +35,7 @@ index_t obi_index_array(Obi_indexer_p indexer, const void* value, uint8_t elt_si
// for (int i=0; i<value_length; i++)
// fprintf(stderr, "\nvalue %d", ((obibool_t*)value)[i]);
length_bytes = value_length * elt_size;
length_bytes = value_length * elt_size / 8;
// Encode value
value_b = obi_blob((byte_t*)value, elt_size, length_bytes, length_bytes);
......@@ -62,7 +62,7 @@ const void* obi_retrieve_array(Obi_indexer_p indexer, index_t idx, int32_t* valu
value_b = obi_indexer_get(indexer, idx);
// Store array length
*value_length_p = (value_b->length_decoded_value) / (value_b->element_size);
*value_length_p = (value_b->length_decoded_value) / (value_b->element_size) * 8;
// Return pointer on mapped array
return ((void*) (value_b->value));
......
Markdown is supported
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