mirror of
https://github.com/apache/nuttx.git
synced 2026-09-07 17:36:38 +00:00
drivers/video: Fix crash caused by priv->capture_cb = null
When the upper layer calls goldfish_camera_data_uninit, priv->capture_cb=NULL, but when there is data transmission in goldfish_camera_thread, priv->capture_cb will be called, which will cause a crash. Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
This commit is contained in:
parent
f6681218f4
commit
e0873c5a48
1 changed files with 5 additions and 0 deletions
|
|
@ -464,6 +464,11 @@ reload:
|
|||
|
||||
DEBUGASSERT(ret == priv->buf_size);
|
||||
|
||||
if (priv->capture_cb == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
clock_systime_timespec(&ts);
|
||||
TIMESPEC_TO_TIMEVAL(&tv, &ts);
|
||||
priv->capture_cb(0, priv->buf_size, &tv, priv->capture_arg);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue