diff mbox series

[FFmpeg-devel,6/6] Revert "lavfi/avfiltergraph: add check before free the format"

Message ID 20200808140202.586-6-andreas.rheinhardt@gmail.com
State Accepted
Commit c4c10feaa8c3604abfec4283715b37358f73b6e7
Headers show
Series [FFmpeg-devel,1/6] avfilter/formats: Remove ff_make_formatu64_list() | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 8, 2020, 2:02 p.m. UTC
This reverts commit f156f4ab2317f22bfef33c7eaead0d5d5f162903.

The checks added by said commit are nonsense because they did not help
in case ff_merge_samplerates() or ff_merge_formats() returned NULL
while freeing one of its arguments: Said freeing does not change
the local variables of can_merge_formats().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavfilter/avfiltergraph.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Nicolas George Aug. 8, 2020, 3:33 p.m. UTC | #1
Andreas Rheinhardt (12020-08-08):
> This reverts commit f156f4ab2317f22bfef33c7eaead0d5d5f162903.
> 
> The checks added by said commit are nonsense because they did not help
> in case ff_merge_samplerates() or ff_merge_formats() returned NULL
> while freeing one of its arguments: Said freeing does not change
> the local variables of can_merge_formats().

LGTM, thanks.

Regards,
diff mbox series

Patch

diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index 2fe4f0b0f9..a149f8fb6d 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -419,10 +419,8 @@  static int can_merge_formats(AVFilterFormats *a_arg,
         av_freep(&ret);
         return 1;
     } else {
-        if (a)
-            av_freep(&a->formats);
-        if (b)
-            av_freep(&b->formats);
+        av_freep(&a->formats);
+        av_freep(&b->formats);
         av_freep(&a);
         av_freep(&b);
         return 0;