From f6ae00a6bb5d55b48fc2074b5abccad0bccee641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Fri, 11 Sep 2015 16:49:16 +0200 Subject: [PATCH] decoder: h264: initialize PPS's slice_group_id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the GstVaapiParserInfoH264 is allocated, the memory is not initialized, so it contains random data. When gst_h264_parser_parse_pps() fails, the PPS structure keeps slice_group_id pointer uninitialized, leading to a segmentation fault when the memory is freed. This patch prevents this by initializing the slice_group_id before the PPS parsing. Signed-off-by: Víctor Manuel Jáquez Leal https://bugzilla.gnome.org/show_bug.cgi?id=754845 --- gst-libs/gst/vaapi/gstvaapidecoder_h264.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c index 3947a44504..55cb3962bc 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c @@ -1713,6 +1713,7 @@ parse_pps(GstVaapiDecoderH264 *decoder, GstVaapiDecoderUnit *unit) standard but that should get a default value anyway */ pps->slice_group_map_type = 0; pps->slice_group_change_rate_minus1 = 0; + pps->slice_group_id = NULL; result = gst_h264_parser_parse_pps(priv->parser, &pi->nalu, pps); if (result != GST_H264_PARSER_OK)