fftools/ffmpeg_mux_init: don't free the AVDictionaryEntry until after it's been used

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2024-01-22 13:46:30 -03:00
parent ab39cc36c7
commit d2eb6f4d44
1 changed files with 1 additions and 1 deletions

View File

@ -2145,7 +2145,6 @@ static int of_parse_iamf_submixes(Muxer *mux, AVStreamGroup *stg, char *ptr)
if (e = av_dict_get(dict, "stg", NULL, 0))
idx = strtoll(e->value, &endptr, 0);
av_dict_set(&dict, "stg", NULL, 0);
if (!endptr || *endptr || idx < 0 || idx >= oc->nb_stream_groups - 1 ||
oc->stream_groups[idx]->type != AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT) {
av_log(mux, AV_LOG_ERROR, "Invalid or missing stream group index in "
@ -2166,6 +2165,7 @@ static int of_parse_iamf_submixes(Muxer *mux, AVStreamGroup *stg, char *ptr)
av_iamf_param_definition_alloc(AV_IAMF_PARAMETER_DEFINITION_MIX_GAIN, 0, NULL);
if (!submix_element->element_mix_config)
ret = AVERROR(ENOMEM);
av_dict_set(&dict, "stg", NULL, 0);
av_opt_set_dict2(submix_element, &dict, AV_OPT_SEARCH_CHILDREN);
} else if (layout) {
AVIAMFSubmixLayout *submix_layout = av_iamf_submix_add_layout(submix);