diff --git a/common_video/h265/h265_bitstream_parser.cc b/common_video/h265/h265_bitstream_parser.cc index c9d17b0628..ee41a79cc7 100644 --- a/common_video/h265/h265_bitstream_parser.cc +++ b/common_video/h265/h265_bitstream_parser.cc @@ -419,6 +419,10 @@ const H265SpsParser::SpsState* H265BitstreamParser::GetSPS(uint32_t id) const { } void H265BitstreamParser::ParseSlice(rtc::ArrayView slice) { + if (slice.empty()) { + RTC_LOG(LS_WARNING) << "Empty slice in H265 bitstream."; + return; + } H265::NaluType nalu_type = H265::ParseNaluType(slice[0]); switch (nalu_type) { case H265::NaluType::kVps: {