diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2015-03-02 12:04:00 +0100 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2015-03-02 15:10:51 -0500 |
commit | 8cd40e77b70dae2a7b76f41c47a753a526d4da49 (patch) | |
tree | e35636e41583e759419050ed07750ab4ae6d4d45 /sys/v4l2/gstv4l2bufferpool.c | |
parent | 379621fd0b914e0f876c31344e9565618d1ffea8 (diff) |
v4l2allocator: fix fd leak in DMABUF import mode.
Ensure gst_v4l2_buffer_pool_release_buffer() releases the associated
GstV4l2MemoryGroup. In particular, this allows for closing the DMABUF
handles prior to instantiating new ones.
https://bugzilla.gnome.org/show_bug.cgi?id=745443
Diffstat (limited to 'sys/v4l2/gstv4l2bufferpool.c')
-rw-r--r-- | sys/v4l2/gstv4l2bufferpool.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c index e0604dcdd..3f36cea70 100644 --- a/sys/v4l2/gstv4l2bufferpool.c +++ b/sys/v4l2/gstv4l2bufferpool.c @@ -1364,7 +1364,9 @@ gst_v4l2_buffer_pool_release_buffer (GstBufferPool * bpool, GstBuffer * buffer) case GST_V4L2_IO_USERPTR: case GST_V4L2_IO_DMABUF_IMPORT: { - if (gst_v4l2_is_buffer_valid (buffer, NULL)) { + GstV4l2MemoryGroup *group; + if (gst_v4l2_is_buffer_valid (buffer, &group)) { + gst_v4l2_allocator_reset_group (pool->vallocator, group); /* queue back in the device */ if (pool->other_pool) gst_v4l2_buffer_pool_prepare_buffer (pool, buffer, NULL); |