spa: v4l2: avoid integer wraparound to out of bounds read

I'm not sure if untrusted input can reach this point.
This commit is contained in:
Demi Marie Obenour 2025-07-10 11:10:25 -04:00 committed by Wim Taymans
parent 2c2808fab1
commit 5bfc3e6b03

View file

@ -399,7 +399,7 @@ enum_filter_format(uint32_t media_type, int32_t media_subtype,
if (index == 0) if (index == 0)
video_format = values[0]; video_format = values[0];
} else { } else {
if (index + 1 < n_values) if (index < n_values - 1)
video_format = values[index + 1]; video_format = values[index + 1];
} }
} else { } else {