Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Unified Diff: webrtc/modules/video_coding/frame_buffer2.cc

Issue 2879073002: Add a couple of checks to FrameBuffer while we're continuing to look at RtpFrameReferenceFinder. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/frame_buffer2.cc
diff --git a/webrtc/modules/video_coding/frame_buffer2.cc b/webrtc/modules/video_coding/frame_buffer2.cc
index 8d86a6412a076f295f22b4546b84d21d3189651c..584c2f03c4c2af81505023e2c70fa5d4b66bf232 100644
--- a/webrtc/modules/video_coding/frame_buffer2.cc
+++ b/webrtc/modules/video_coding/frame_buffer2.cc
@@ -345,11 +345,15 @@ void FrameBuffer::PropagateContinuity(FrameMap::iterator start) {
void FrameBuffer::PropagateDecodability(const FrameInfo& info) {
TRACE_EVENT0("webrtc", "FrameBuffer::PropagateDecodability");
+ RTC_CHECK(info.num_dependent_frames < FrameInfo::kMaxNumDependentFrames);
for (size_t d = 0; d < info.num_dependent_frames; ++d) {
auto ref_info = frames_.find(info.dependent_frames[d]);
RTC_DCHECK(ref_info != frames_.end());
- RTC_DCHECK_GT(ref_info->second.num_missing_decodable, 0U);
- --ref_info->second.num_missing_decodable;
+ // TODO(philipel): Look into why we've seen this happen.
+ if (ref_info != frames_.end()) {
+ RTC_DCHECK_GT(ref_info->second.num_missing_decodable, 0U);
+ --ref_info->second.num_missing_decodable;
+ }
}
}
@@ -418,7 +422,14 @@ bool FrameBuffer::UpdateFrameInfoWithIncomingFrame(const FrameObject& frame,
// frames are inserted or decoded.
ref_info->second.dependent_frames[ref_info->second.num_dependent_frames] =
key;
- ++ref_info->second.num_dependent_frames;
+ RTC_DCHECK_LT(ref_info->second.num_dependent_frames,
+ (FrameInfo::kMaxNumDependentFrames - 1));
+ // TODO(philipel): Look into why this could happen and handle
+ // appropriately.
+ if (ref_info->second.num_dependent_frames <
+ (FrameInfo::kMaxNumDependentFrames - 1)) {
+ ++ref_info->second.num_dependent_frames;
+ }
}
RTC_DCHECK_LE(ref_info->second.num_missing_continuous,
ref_info->second.num_missing_decodable);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698