From d9ef88230f3aaf17a6e6556fa4a116c3a3423a1d Mon Sep 17 00:00:00 2001 From: Allen Zhang Date: Thu, 21 Jul 2016 11:24:31 +0300 Subject: [PATCH] decoder: h265: handle the SEI NAL units included in codec_data The prefix/suffix SEI nal units can appear in codec_data too which weren't handled before. Parse these SEI headers to fix the segfault. https://bugzilla.gnome.org/show_bug.cgi?id=768544 --- gst-libs/gst/vaapi/gstvaapidecoder_h265.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c index ef703d02b3..d44047c7a8 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c @@ -2696,6 +2696,16 @@ gst_vaapi_decoder_h265_decode_codec_data (GstVaapiDecoder * if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) goto cleanup; break; + case GST_H265_NAL_SUFFIX_SEI: + case GST_H265_NAL_PREFIX_SEI: + status = parse_sei (decoder, &unit); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + goto cleanup; + status = decode_sei (decoder, &unit); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + goto cleanup; + break; + } ofs = pi->nalu.offset + pi->nalu.size; gst_vaapi_parser_info_h265_replace (&pi, NULL);