video/v4l2_cap: fix dereference before null check
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
This commit is contained in:
parent
33b539a07d
commit
47905c9132
@ -2132,8 +2132,7 @@ static int capture_reqbufs(FAR struct file *filep,
|
|||||||
FAR struct inode *inode = filep->f_inode;
|
FAR struct inode *inode = filep->f_inode;
|
||||||
FAR capture_mng_t *cmng = inode->i_private;
|
FAR capture_mng_t *cmng = inode->i_private;
|
||||||
FAR capture_type_inf_t *type_inf;
|
FAR capture_type_inf_t *type_inf;
|
||||||
struct imgdata_s *imgdata = cmng->imgdata;
|
struct imgdata_s *imgdata;
|
||||||
|
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
int ret = OK;
|
int ret = OK;
|
||||||
|
|
||||||
@ -2142,6 +2141,7 @@ static int capture_reqbufs(FAR struct file *filep,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
imgdata = cmng->imgdata;
|
||||||
type_inf = get_capture_type_inf(cmng, reqbufs->type);
|
type_inf = get_capture_type_inf(cmng, reqbufs->type);
|
||||||
if (type_inf == NULL)
|
if (type_inf == NULL)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user