diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2013-10-22 19:40:05 +0100 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2013-10-27 19:15:03 +0000 |
commit | 52aed19307ee0768b03a620005c4b2b5fda621c6 (patch) | |
tree | 56f5259c85bd43b63faf33b1b108c26ebd8c2596 | |
parent | 6ef30976e00a07ed7c6db54102d2ba50d24c876c (diff) | |
download | ffmpeg-52aed19307ee0768b03a620005c4b2b5fda621c6.tar.gz |
avfiltergraph: Properly handle memory allocation failure
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
-rw-r--r-- | libavfilter/avfiltergraph.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index 2db2900ea8..506d79ec71 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -392,6 +392,19 @@ static int can_merge_formats(AVFilterFormats *a_arg, return 1; a = clone_filter_formats(a_arg); b = clone_filter_formats(b_arg); + + if (!a || !b) { + if (a) + av_freep(&a->formats); + if (b) + av_freep(&b->formats); + + av_freep(&a); + av_freep(&b); + + return 0; + } + if (is_sample_rate) { ret = ff_merge_samplerates(a, b); } else { |