Skip to content

`ivas_ism_metadata_dec_create` always allocating 4 decoders

In the decoder, the function ivas_ism_metadata_dec_create always allocates full MAX_NUM_OBJECTS (i.e., 4) ISM metadata structures ignoring the argument n_ISms in the allocation.

ivas_error ivas_ism_metadata_dec_create(
    Decoder_Struct *st_ivas,    /* i/o: IVAS decoder structure      */
    const int16_t n_ISms,       /* i  : number of objects           */
    int32_t element_brate_tmp[] /* o  : element bitrate per object  */
)

Some formats (e.g., OMASA) already account for this and free the extra structures after the allocation.

It would be more efficient to allocate only the number that is requested.