diff options
-rw-r--r-- | src/libcamera/dma_buf_allocator.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libcamera/dma_buf_allocator.cpp b/src/libcamera/dma_buf_allocator.cpp index a014c3b4..d8c62dd6 100644 --- a/src/libcamera/dma_buf_allocator.cpp +++ b/src/libcamera/dma_buf_allocator.cpp @@ -325,7 +325,12 @@ DmaSyncer::DmaSyncer(SharedFD fd, SyncType type) DmaSyncer::~DmaSyncer() { - sync(DMA_BUF_SYNC_END); + /* + * DmaSyncer might be moved and left with an empty SharedFD. + * Avoid syncing with an invalid file descriptor in this case. + */ + if (fd_.isValid()) + sync(DMA_BUF_SYNC_END); } void DmaSyncer::sync(uint64_t step) |