Although the components' initialization code would fill in -1 to all
unset components, make the code a bit more defensive and check for an
index bound first.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2231>
guint * hs)
{
gint comp[GST_VIDEO_MAX_COMPONENTS];
- gint i;
+ gint i = 1;
gst_video_format_info_component (finfo, plane, comp);
/* 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++)
+ while (i < GST_VIDEO_MAX_COMPONENTS && comp[i] >= 0) {
*ws += 1;
+ i++;
+ }
}