diff options
author | He Junyan <junyan.he@hotmail.com> | 2019-08-27 18:12:45 +0800 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2019-09-02 12:21:37 +0100 |
commit | 96485042a0bd2e2c17687743fa6f9e6ce6d0e105 (patch) | |
tree | c51acf2cf9bfa71444cf23b39d1040278fa7cd46 | |
parent | a253aff9fa3b957ede3de48b1fe0495938004ae5 (diff) |
libs: postproc: fix a memory leak point.
filter_ops and filter_formats should already have valid value when
the function gst_vaapipostproc_ensure_filter_caps re-enter
-rw-r--r-- | gst/vaapi/gstvaapipostproc.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gst/vaapi/gstvaapipostproc.c b/gst/vaapi/gstvaapipostproc.c index 55e3a566..06b0bfc7 100644 --- a/gst/vaapi/gstvaapipostproc.c +++ b/gst/vaapi/gstvaapipostproc.c @@ -244,13 +244,17 @@ gst_vaapipostproc_ensure_filter_caps (GstVaapiPostproc * postproc) if (!gst_vaapipostproc_ensure_filter (postproc)) return FALSE; - postproc->filter_ops = gst_vaapi_filter_get_operations (postproc->filter); - if (!postproc->filter_ops) - return FALSE; + if (!postproc->filter_ops) { + postproc->filter_ops = gst_vaapi_filter_get_operations (postproc->filter); + if (!postproc->filter_ops) + return FALSE; + } - postproc->filter_formats = gst_vaapi_filter_get_formats (postproc->filter); - if (!postproc->filter_formats) - return FALSE; + if (!postproc->filter_formats) { + postproc->filter_formats = gst_vaapi_filter_get_formats (postproc->filter); + if (!postproc->filter_formats) + return FALSE; + } return TRUE; } |