codecparsers: h265parser: Correct the read of slice_sao_chroma_flag.

According to the SPEC, for parsing the slice header, we should read the
slice_sao_chroma_flag only when ChromaArrayType is not equal to 0.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1488>
This commit is contained in:
He Junyan 2022-01-03 22:15:12 +08:00
parent ccf64e369e
commit e1f9c6d559

View file

@ -2563,7 +2563,8 @@ gst_h265_parser_parse_slice_hdr (GstH265Parser * parser,
if (sps->sample_adaptive_offset_enabled_flag) {
READ_UINT8 (&nr, slice->sao_luma_flag, 1);
READ_UINT8 (&nr, slice->sao_chroma_flag, 1);
if (sps->chroma_array_type)
READ_UINT8 (&nr, slice->sao_chroma_flag, 1);
}
if (GST_H265_IS_B_SLICE (slice) || GST_H265_IS_P_SLICE (slice)) {