libcamera: raspberry: Fix segfault in ~RPiCameraData()
The RPiCameraData class destructor tries to stop its ipa_ instance without making sure it has been initialized. If the RPiCameraData gets destroyed before its ipa_ member is initialized, for example if the sensor initialization fails during the match() function, a nullptr dereference segfault is triggered preventing a graceful library teardown. Fix this by checking for ipa_ to be initialized before stopping it. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
parent
c31785156b
commit
e8cc0a2658
1 changed files with 2 additions and 1 deletions
|
@ -304,7 +304,8 @@ public:
|
|||
}
|
||||
|
||||
/* Stop the IPA proxy thread. */
|
||||
ipa_->stop();
|
||||
if (ipa_)
|
||||
ipa_->stop();
|
||||
}
|
||||
|
||||
void frameStarted(uint32_t sequence);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue