aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-01-22 13:46:30 -0300
committerJames Almer <jamrial@gmail.com>2024-01-22 13:46:57 -0300
commitd2eb6f4d44d262be32c212a3d06ad8ad78f2a239 (patch)
tree17ac7e3ea7755e70bc3b1e0837c67c27359edeaf
parentab39cc36c72bb73318bb911acb66873de850a107 (diff)
downloadffmpeg-d2eb6f4d44d262be32c212a3d06ad8ad78f2a239.tar.gz
fftools/ffmpeg_mux_init: don't free the AVDictionaryEntry until after it's been used
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--fftools/ffmpeg_mux_init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index 15200c5a7d..6b5e4f8b3c 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -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);