summaryrefslogtreecommitdiff
path: root/libavfilter/avfiltergraph.c
diff options
context:
space:
mode:
authorJun Zhao <barryjzhao@tencent.com>2019-08-19 13:22:34 +0800
committerJun Zhao <barryjzhao@tencent.com>2019-08-20 10:06:17 +0800
commitf156f4ab2317f22bfef33c7eaead0d5d5f162903 (patch)
tree4a24a28ac5a4aa3e2755d01e57ecb0d3d0cf8fd2 /libavfilter/avfiltergraph.c
parentdf6876d69172140eb315a914a924abece2c6481a (diff)
lavfi/avfiltergraph: add check before free the format
ff_merge_samplerates will be deallocate a or b in some case, so add a check before free the format. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Diffstat (limited to 'libavfilter/avfiltergraph.c')
-rw-r--r--libavfilter/avfiltergraph.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index a149f8fb6d..2fe4f0b0f9 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -419,8 +419,10 @@ static int can_merge_formats(AVFilterFormats *a_arg,
av_freep(&ret);
return 1;
} else {
- av_freep(&a->formats);
- av_freep(&b->formats);
+ if (a)
+ av_freep(&a->formats);
+ if (b)
+ av_freep(&b->formats);
av_freep(&a);
av_freep(&b);
return 0;