From: Nicolas Dufresne Date: Tue, 12 Jul 2022 19:44:45 +0000 (-0400) Subject: v4l2codecs: h264: Fix initialization of the slice array X-Git-Tag: 1.22.0~1236 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c2144ec58693a2573e6836a44ef5620a16540189;p=platform%2Fupstream%2Fgstreamer.git v4l2codecs: h264: Fix initialization of the slice array The function g_array_sized_new() leaves the len to 0, but the slice implementation assumes it would be set to 4. Sending multiple slices is not yet support for H.264 as no driver needed it yet, but if that code was to be used it would have overflowed as the array would never grow as multiple 0 by 2 always results in 0. Part-of: --- diff --git a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c index 2c46dc3..0df76a2 100644 --- a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c +++ b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c @@ -1460,6 +1460,7 @@ gst_v4l2_codec_h264_dec_subinit (GstV4l2CodecH264Dec * self, gst_video_info_init (&self->vinfo); self->slice_params = g_array_sized_new (FALSE, TRUE, sizeof (struct v4l2_ctrl_h264_slice_params), 4); + g_array_set_size (self->slice_params, 4); } static void