summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-01-17 12:54:21 +0100
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-01-19 10:37:02 +0000
commiteda173b3b089fc6da88c8fb77b9f9bdacb83dfb7 (patch)
tree3dcdc41ba3c1cb1b53c26587e921a5fd92418990
parent6eafebc80474cc8a19d5e886b19948dbc52944f6 (diff)
libs: encoder: unref formats array if none
The formats array is always created, in order to keep the logic and to avoid broken caps, if this formats array doesn't contain any elements, it has to be unref and the function should return NULL.
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder.c b/gst-libs/gst/vaapi/gstvaapiencoder.c
index 771a82b7..edc443ab 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder.c
+++ b/gst-libs/gst/vaapi/gstvaapiencoder.c
@@ -1577,8 +1577,10 @@ gst_vaapi_encoder_get_surface_attributes (GstVaapiEncoder * encoder,
}
}
- if (!attribs.formats)
+ if (attribs.formats->len == 0) {
+ g_array_unref (attribs.formats);
return NULL;
+ }
if (min_width)
*min_width = attribs.min_width;