summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2017-08-01 17:23:48 +0200
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2017-08-24 13:04:22 +0200
commitfbfd9a2759adf896386068c242b26b58c015f093 (patch)
tree81690b001937f0d3284860d643b42825261bcc43
parent13a6c6e27cf816c867990aa827bd56cabc5d576b (diff)
vaapipostproc: fix memory leaks
-rw-r--r--gst/vaapi/gstvaapipostprocutil.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gst/vaapi/gstvaapipostprocutil.c b/gst/vaapi/gstvaapipostprocutil.c
index 4bfc169c..9c344b12 100644
--- a/gst/vaapi/gstvaapipostprocutil.c
+++ b/gst/vaapi/gstvaapipostprocutil.c
@@ -256,8 +256,10 @@ _fixate_frame_size (GstVaapiPostproc * postproc, GstVideoInfo * vinfo,
/* Might have failed but try to keep the DAR nonetheless by
* adjusting the PAR */
if (!gst_util_fraction_multiply (from_dar_n, from_dar_d, h, set_w,
- &to_par_n, &to_par_d))
+ &to_par_n, &to_par_d)) {
+ gst_structure_free (tmp);
goto overflow_error;
+ }
if (!gst_structure_has_field (tmp, "pixel-aspect-ratio"))
gst_structure_set_value (tmp, "pixel-aspect-ratio", to_par);
@@ -328,8 +330,10 @@ _fixate_frame_size (GstVaapiPostproc * postproc, GstVideoInfo * vinfo,
/* Might have failed but try to keep the DAR nonetheless by
* adjusting the PAR */
if (!gst_util_fraction_multiply (from_dar_n, from_dar_d, set_h, w,
- &to_par_n, &to_par_d))
+ &to_par_n, &to_par_d)) {
+ gst_structure_free (tmp);
goto overflow_error;
+ }
if (!gst_structure_has_field (tmp, "pixel-aspect-ratio"))
gst_structure_set_value (tmp, "pixel-aspect-ratio", to_par);
@@ -439,8 +443,10 @@ _fixate_frame_size (GstVaapiPostproc * postproc, GstVideoInfo * vinfo,
gst_structure_get_int (tmp, "width", &set_w);
if (!gst_util_fraction_multiply (from_dar_n, from_dar_d, set_h, set_w,
- &to_par_n, &to_par_d))
+ &to_par_n, &to_par_d)) {
+ gst_structure_free (tmp);
goto overflow_error;
+ }
if (!gst_structure_has_field (tmp, "pixel-aspect-ratio"))
gst_structure_set_value (tmp, "pixel-aspect-ratio", to_par);