From da3e5c573a261117cbd70dc079a333bcd610a1d7 Mon Sep 17 00:00:00 2001 From: Bryan Ndjeutcha Date: Fri, 29 Dec 2023 10:28:46 -0500 Subject: [PATCH] fix: MultiPool::get returns an overlap error when its appropriate PoolError::Overlap is returned when the buffer is bigger than the slot and not the other way around. --- src/shm/multi.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shm/multi.rs b/src/shm/multi.rs index 2e82c1aaa..bc903f480 100644 --- a/src/shm/multi.rs +++ b/src/shm/multi.rs @@ -322,7 +322,7 @@ impl MultiPool { let size = (stride * height) as usize; let buf_slot = self.buffer_list.get_mut(index).ok_or(PoolError::NotFound)?; - if buf_slot.size > size { + if size > buf_slot.size { return Err(PoolError::Overlap); }