summaryrefslogtreecommitdiff
path: root/media-plugins/gst-plugins-libav/files/AVOptionsRanges-leak-fix.patch
blob: 5594dbc1ab80dce704bf9fbbcb0ab7de7c142e00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From a2c88ec9dadf4a6d7f5f7b16feb2c5c2e155d72d Mon Sep 17 00:00:00 2001
From: Seungha Yang <seungha.yang@navercorp.com>
Date: Sun, 13 Jan 2019 00:46:50 +0900
Subject: [PATCH] avcfg: Fix AVOptionRanges leak

It must be freed with av_opt_freep_ranges as documented.
---
 ext/libav/gstavcfg.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/ext/libav/gstavcfg.c b/ext/libav/gstavcfg.c
index 9236078..9d34462 100644
--- a/ext/libav/gstavcfg.c
+++ b/ext/libav/gstavcfg.c
@@ -252,10 +252,12 @@ install_opts (GObjectClass * gobject_class, const AVClass ** obj, guint prop_id,
     if (g_object_class_find_property (gobject_class, name))
       continue;
 
-    if (av_opt_query_ranges (&r, obj, opt->name, AV_OPT_SEARCH_FAKE_OBJ) >= 0
-        && r->nb_ranges == 1) {
-      min = r->range[0]->value_min;
-      max = r->range[0]->value_max;
+    if (av_opt_query_ranges (&r, obj, opt->name, AV_OPT_SEARCH_FAKE_OBJ) >= 0) {
+      if (r->nb_ranges == 1) {
+        min = r->range[0]->value_min;
+        max = r->range[0]->value_max;
+      }
+      av_opt_freep_ranges (&r);
     }
 
     help = g_strdup_printf ("%s%s", opt->help, extra_help);
-- 
2.17.0