From 13a397a0b92b4c68cbe328095947887c10335e7e Mon Sep 17 00:00:00 2001 From: "duhui.lee" Date: Mon, 20 Jan 2014 17:03:09 +0900 Subject: [PATCH] h265parser: Fix segfault when parsing HRD parameter https://bugzilla.gnome.org/show_bug.cgi?id=722240 --- gst-libs/gst/codecparsers/gsth265parser.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gst-libs/gst/codecparsers/gsth265parser.c b/gst-libs/gst/codecparsers/gsth265parser.c index 94fed0e..cfad2b9 100644 --- a/gst-libs/gst/codecparsers/gsth265parser.c +++ b/gst-libs/gst/codecparsers/gsth265parser.c @@ -1749,12 +1749,14 @@ gst_h265_parse_vps (GstH265NalUnit * nalu, GstH265VPS * vps) READ_UE_ALLOWED (&nr, vps->num_hrd_parameters, 0, 1024); CHECK_ALLOWED (vps->num_hrd_parameters, 0, 1); - READ_UE_ALLOWED (&nr, vps->hrd_layer_set_idx, 0, 1023); - CHECK_ALLOWED (vps->hrd_layer_set_idx, 0, 0); + if (vps->num_hrd_parameters) { + READ_UE_ALLOWED (&nr, vps->hrd_layer_set_idx, 0, 1023); + CHECK_ALLOWED (vps->hrd_layer_set_idx, 0, 0); - if (!gst_h265_parse_hrd_parameters (&vps->hrd_params, &nr, - vps->cprms_present_flag, vps->max_sub_layers_minus1)) - goto error; + if (!gst_h265_parse_hrd_parameters (&vps->hrd_params, &nr, + vps->cprms_present_flag, vps->max_sub_layers_minus1)) + goto error; + } } READ_UINT8 (&nr, vps->vps_extension, 1); vps->valid = TRUE; -- 2.7.4