mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 04:00:37 +00:00
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.
This commit is contained in:
parent
6eafebc804
commit
eda173b3b0
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (min_width)
|
if (min_width)
|
||||||
*min_width = attribs.min_width;
|
*min_width = attribs.min_width;
|
||||||
|
|
Loading…
Reference in a new issue