avformat/iamf_writer: reject duplicated stream ids in a stream group

Signed-off-by: James Almer <jamrial@gmail.com>
release/7.1
James Almer 7 months ago
parent 257bc2a82a
commit 6b6a0fc53d
  1. 11
      libavformat/iamf_writer.c

@ -275,6 +275,17 @@ int ff_iamf_add_audio_element(IAMFContext *iamf, const AVStreamGroup *stg, void
}
}
for (int i = 0; i < audio_element->nb_substreams; i++) {
for (int j = i + 1; j < audio_element->nb_substreams; j++)
if (audio_element->substreams[i].audio_substream_id ==
audio_element->substreams[j].audio_substream_id) {
av_log(log_ctx, AV_LOG_ERROR, "Duplicate id %u in streams %u and %u from stream group %u\n",
audio_element->substreams[i].audio_substream_id, i, j, stg->index);
ret = AVERROR(EINVAL);
goto fail;
}
}
if (iamf_audio_element->demixing_info) {
AVIAMFParamDefinition *param = iamf_audio_element->demixing_info;
const IAMFParamDefinition *param_definition = ff_iamf_get_param_definition(iamf, param->parameter_id);

Loading…
Cancel
Save