File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -421,6 +421,10 @@ static inline int video_set_frmival(const struct device *dev, struct video_frmiv
421
421
__ASSERT_NO_MSG (dev != NULL );
422
422
__ASSERT_NO_MSG (frmival != NULL );
423
423
424
+ if (frmival -> numerator == 0 || frmival -> denominator == 0 ) {
425
+ return - EINVAL ;
426
+ }
427
+
424
428
api = (const struct video_driver_api * )dev -> api ;
425
429
if (api -> set_frmival == NULL ) {
426
430
return - ENOSYS ;
@@ -803,6 +807,7 @@ int video_format_caps_index(const struct video_format_cap *fmts, const struct vi
803
807
static inline uint64_t video_frmival_nsec (const struct video_frmival * frmival )
804
808
{
805
809
__ASSERT_NO_MSG (frmival != NULL );
810
+ __ASSERT_NO_MSG (frmival -> denominator != 0 );
806
811
807
812
return (uint64_t )NSEC_PER_SEC * frmival -> numerator / frmival -> denominator ;
808
813
}
You can’t perform that action at this time.
0 commit comments