mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
xvimagesink: Don't leak XvShmImage
If allocating an XvShmImage generates an X error, but still returns some allocated memory, make sure to free it so it doesn't leak. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3100>
This commit is contained in:
parent
6b7d4f74f2
commit
eef76a9491
1 changed files with 7 additions and 0 deletions
|
@ -383,6 +383,13 @@ gst_xvimage_allocator_alloc (GstXvImageAllocator * allocator, gint im_format,
|
||||||
context->xv_port_id, im_format, NULL, padded_width, padded_height,
|
context->xv_port_id, im_format, NULL, padded_width, padded_height,
|
||||||
&mem->SHMInfo);
|
&mem->SHMInfo);
|
||||||
if (!mem->xvimage || error_caught) {
|
if (!mem->xvimage || error_caught) {
|
||||||
|
|
||||||
|
/* If the memory was allocated, drop it */
|
||||||
|
if (mem->xvimage) {
|
||||||
|
XFree (mem->xvimage);
|
||||||
|
mem->xvimage = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
g_mutex_unlock (&context->lock);
|
g_mutex_unlock (&context->lock);
|
||||||
|
|
||||||
/* Reset error flag */
|
/* Reset error flag */
|
||||||
|
|
Loading…
Reference in a new issue