libcamera: Request: validate state on complete
Requests should only be completed from the RequestPending state. Requests which are completed from the RequestCancelled, or RequestComplete state, will indicate that a double-complete has been called on the Request, or that it has been used internally after it has been given back to the application. Ensure that this can be caught early if it occurs by enforcing the state required with an assert. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <email@uajain.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
de1b994bba
commit
2cf0c87511
1 changed files with 2 additions and 0 deletions
|
@ -262,7 +262,9 @@ FrameBuffer *Request::findBuffer(const Stream *stream) const
|
|||
*/
|
||||
void Request::complete()
|
||||
{
|
||||
ASSERT(status_ == RequestPending);
|
||||
ASSERT(!hasPendingBuffers());
|
||||
|
||||
status_ = cancelled_ ? RequestCancelled : RequestComplete;
|
||||
|
||||
LOG(Request, Debug)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue