Fix 2 iterations that can overrun the array if the number of component is
equal to the size of the array.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2239>
* number of component on the first plane against the number of component on
* the current plane. */
estride = 0;
- for (i = 0; comp[i] >= 0; i++)
+ for (i = 0; i < GST_VIDEO_MAX_COMPONENTS && comp[i] >= 0; i++)
estride += GST_VIDEO_FORMAT_INFO_SCALE_WIDTH (finfo, comp[i], stride);
return estride;
/* for each additional component in the same plane, double the tile width,
* this should provide the appropriate tile size when the tile size varies
* base on the subsampling. */
- for (i = 1; comp[i] >= 0; i++)
+ for (i = 1; i < GST_VIDEO_MAX_COMPONENTS && comp[i] >= 0; i++)
*ws += 1;
}