func: static void read_nested_curveType(struct mem_source *src, struct curveType *(*curveArray)[MAX_CHANNELS], uint8_t num_channels, uint32_t curve_offset) uint32_t channel_offset = 0 ; int i ; for (i = 0; i < num_channels; i++) uint32_t tag_len ; ( * curveArray ) [ i ] = read_curveType ( src , curve_offset + channel_offset , & tag_len ); channel_offset += tag_len; if ( ( tag_len % 4 ) != 0 )  channel_offset += 4 - ( tag_len % 4 ); static struct curveType *read_curveType(struct mem_source *src, uint32_t offset, uint32_t *len) static const uint32_t COUNT_TO_LENGTH [ 5 ] = { 1 , 3 , 4 , 5 , 7 } ; uint32_t type = read_u32 ( src , offset ) ; uint32_t count ; uint32_t i ; if ( type != CURVE_TYPE && type != PARAMETRIC_CURVE_TYPE )  if ( type == CURVE_TYPE )  count = read_u16 ( src , offset + 8 ); if ( count > 4 )  curve = malloc ( sizeof ( struct curveType ) ); if ( ! curve )  curve -> count = count; curve -> type = PARAMETRIC_CURVE_TYPE; for (i=0; i < COUNT_TO_LENGTH[count]; i++) curve -> parameter [ i ] = s15Fixed16Number_to_float ( read_s15Fixed16Number ( src , offset + 12 + i * 4 ) ); static s15Fixed16Number read_s15Fixed16Number(struct mem_source *mem, size_t offset) return read_u32 ( mem , offset ) ; static uint32_t read_u32(struct mem_source *mem, size_t offset) if ( offset > mem -> size - 4 )  be32 k ; memcpy ( & k , mem -> buf + offset , sizeof ( k ) ); return be32_to_cpu ( k ) ; 