Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 7daab66

Browse files
author
Stefan Holmer
committed
Add a couple of checks to FrameBuffer while we're continuing to look at RtpFrameReferenceFinder.
BUG=chromium:679306 [email protected] [email protected] Review-Url: https://codereview.webrtc.org/2879073002 Cr-Commit-Position: refs/heads/master@{#18140} (cherry picked from commit e95b78b) Review-Url: https://codereview.webrtc.org/2891073002 . Cr-Commit-Position: refs/branch-heads/59@{#11} Cr-Branched-From: 10d095d-refs/heads/master@{#17657}
1 parent 15c68d2 commit 7daab66

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

webrtc/modules/video_coding/frame_buffer2.cc

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,15 @@ void FrameBuffer::PropagateContinuity(FrameMap::iterator start) {
318318

319319
void FrameBuffer::PropagateDecodability(const FrameInfo& info) {
320320
TRACE_EVENT0("webrtc", "FrameBuffer::PropagateDecodability");
321+
RTC_CHECK(info.num_dependent_frames < FrameInfo::kMaxNumDependentFrames);
321322
for (size_t d = 0; d < info.num_dependent_frames; ++d) {
322323
auto ref_info = frames_.find(info.dependent_frames[d]);
323324
RTC_DCHECK(ref_info != frames_.end());
324-
RTC_DCHECK_GT(ref_info->second.num_missing_decodable, 0U);
325-
--ref_info->second.num_missing_decodable;
325+
// TODO(philipel): Look into why we've seen this happen.
326+
if (ref_info != frames_.end()) {
327+
RTC_DCHECK_GT(ref_info->second.num_missing_decodable, 0U);
328+
--ref_info->second.num_missing_decodable;
329+
}
326330
}
327331
}
328332

@@ -391,7 +395,14 @@ bool FrameBuffer::UpdateFrameInfoWithIncomingFrame(const FrameObject& frame,
391395
// frames are inserted or decoded.
392396
ref_info->second.dependent_frames[ref_info->second.num_dependent_frames] =
393397
key;
394-
++ref_info->second.num_dependent_frames;
398+
RTC_DCHECK_LT(ref_info->second.num_dependent_frames,
399+
(FrameInfo::kMaxNumDependentFrames - 1));
400+
// TODO(philipel): Look into why this could happen and handle
401+
// appropriately.
402+
if (ref_info->second.num_dependent_frames <
403+
(FrameInfo::kMaxNumDependentFrames - 1)) {
404+
++ref_info->second.num_dependent_frames;
405+
}
395406
}
396407
RTC_DCHECK_LE(ref_info->second.num_missing_continuous,
397408
ref_info->second.num_missing_decodable);

0 commit comments

Comments
 (0)