mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +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/3147>
This commit is contained in:
parent
2a683372bc
commit
1477dab01d
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