aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/bsf.c
diff options
context:
space:
mode:
authorJun Zhao <barryjzhao@tencent.com>2020-01-01 12:06:47 +0800
committerJun Zhao <barryjzhao@tencent.com>2020-01-04 09:03:30 +0800
commit0099f71502b7b88ae11ea7360d0f751be8d5878e (patch)
tree9749bea9006db12decef8df96220699202cb188d /libavcodec/bsf.c
parent944203270dc37b9cbbc3ead9dfc3fba6bc009789 (diff)
downloadffmpeg-0099f71502b7b88ae11ea7360d0f751be8d5878e.tar.gz
lavc/bsf: fix memory leak after av_dict_parse_string fail
In case of failure, all the successfully set entries are stored in *pm. We need to manually free the created dictionary to avoid memory leak. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Diffstat (limited to 'libavcodec/bsf.c')
-rw-r--r--libavcodec/bsf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/bsf.c b/libavcodec/bsf.c
index c1653cddb0..8e1af6082b 100644
--- a/libavcodec/bsf.c
+++ b/libavcodec/bsf.c
@@ -517,8 +517,8 @@ static int bsf_parse_single(const char *str, AVBSFList *bsf_lst)
ret = av_bsf_list_append2(bsf_lst, bsf_name, &bsf_options);
- av_dict_free(&bsf_options);
end:
+ av_dict_free(&bsf_options);
av_free(buf);
return ret;
}