This repository was archived by the owner on Oct 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -202,6 +202,10 @@ absl::optional<H265PpsParser::PpsState> H265PpsParser::ParseInternal(
202202 // slice_segment_header_extension_present_flag: u(1)
203203 reader.ConsumeBits (1 );
204204
205+ if (!reader.Ok ()) {
206+ return absl::nullopt ;
207+ }
208+
205209 return pps;
206210}
207211
Original file line number Diff line number Diff line change @@ -395,6 +395,10 @@ absl::optional<H265SpsParser::SpsState> H265SpsParser::ParseSpsInternal(
395395 sps.height -= sub_height_c * (conf_win_top_offset + conf_win_bottom_offset);
396396 }
397397
398+ if (!reader.Ok ()) {
399+ return absl::nullopt ;
400+ }
401+
398402 return OptionalSps (sps);
399403}
400404
Original file line number Diff line number Diff line change @@ -43,7 +43,11 @@ absl::optional<H265VpsParser::VpsState> H265VpsParser::ParseInternal(
4343 VpsState vps;
4444
4545 // vps_video_parameter_set_id: u(4)
46- vps.id = reader.Read <uint32_t >();
46+ vps.id = reader.ReadBits (4 );
47+
48+ if (!reader.Ok ()) {
49+ return absl::nullopt ;
50+ }
4751
4852 return vps;
4953}
Original file line number Diff line number Diff line change @@ -447,7 +447,7 @@ std::vector<std::unique_ptr<PacketBuffer::Packet>> PacketBuffer::FindFrames(
447447 }
448448 }
449449#endif
450- if (is_h264 || full_frame_found) {
450+ if (is_h264 || is_h265 || full_frame_found) {
451451 const uint16_t end_seq_num = seq_num + 1 ;
452452 // Use uint16_t type to handle sequence number wrap around case.
453453 uint16_t num_packets = end_seq_num - start_seq_num;
You can’t perform that action at this time.
0 commit comments