Skip to content

Commit 48bbbfe

Browse files
sudarsan-22fabiobaltieri
authored andcommitted
drivers: video: fix NULL dereference in mipid02_get_fmt
Category: Null pointer dereference (CWE-476) Corrects the logic that validates the result of mipid04_get_format_desc(). Previously, the check was inverted, which could lead to a NULL pointer dereference when accessing desc->pixelformat. Fixes Coverity CID: 525183 Signed-off-by: sudarsan N <[email protected]>
1 parent efee13e commit 48bbbfe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/video/video_st_mipid02.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ static int mipid02_get_fmt(const struct device *dev, struct video_format *fmt)
189189
}
190190

191191
desc = mipid02_get_format_desc(fmt->pixelformat);
192-
if (desc) {
192+
if (desc == NULL) {
193193
LOG_ERR("Sensor format not supported by the ST-MIPID02");
194194
return -EIO;
195195
}

0 commit comments

Comments
 (0)