drivers: video: fix null deref in video_get_csi_link_freq()

Add null and bounds checks before accessing int_menu[ctrl.val].

CID: 525179
Fixes: #91244

Signed-off-by: sudarsan N <sudarsansamy2002@gmail.com>
This commit is contained in:
sudarsan N 2025-06-11 11:59:00 +05:30 committed by Benjamin Cabé
commit cda6858d99

View file

@ -419,6 +419,10 @@ int64_t video_get_csi_link_freq(const struct device *dev, uint8_t bpp, uint8_t l
return -ERANGE;
}
if (ctrl_query.int_menu == NULL) {
return -EINVAL;
}
return (int64_t)ctrl_query.int_menu[ctrl.val];
fallback: