From e0ad0eda23940c56da2e6a1c44737cc18920e5b4 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Tue, 19 Apr 2022 10:53:15 -0400 Subject: [PATCH] Revert "video-frame: avoid possible out of bound memory access" This reverts commit c4255f08f787ff6a41504b538fa4c2e911d40ec7. Part-of: --- subprojects/gst-plugins-base/gst-libs/gst/video/video-frame.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-frame.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-frame.c index a1bfe39..d920912 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-frame.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-frame.c @@ -283,7 +283,7 @@ scale_tile_shifts (const GstVideoFormatInfo * finfo, gint plane, guint * ws, guint * hs) { gint comp[GST_VIDEO_MAX_COMPONENTS]; - gint i = 1; + gint i; gst_video_format_info_component (finfo, plane, comp); @@ -294,10 +294,8 @@ scale_tile_shifts (const GstVideoFormatInfo * finfo, gint plane, guint * ws, /* 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. */ - while (i < GST_VIDEO_MAX_COMPONENTS && comp[i] >= 0) { + for (i = 1; comp[i] >= 0; i++) *ws += 1; - i++; - } } -- 2.7.4