Commit 52aed193 authored by Derek Buitenhuis's avatar Derek Buitenhuis

avfiltergraph: Properly handle memory allocation failure

Signed-off-by: 's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
parent 6ef30976
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment