@@ -318,11 +318,15 @@ void FrameBuffer::PropagateContinuity(FrameMap::iterator start) {
318
318
319
319
void FrameBuffer::PropagateDecodability (const FrameInfo& info) {
320
320
TRACE_EVENT0 (" webrtc" , " FrameBuffer::PropagateDecodability" );
321
+ RTC_CHECK (info.num_dependent_frames < FrameInfo::kMaxNumDependentFrames );
321
322
for (size_t d = 0 ; d < info.num_dependent_frames ; ++d) {
322
323
auto ref_info = frames_.find (info.dependent_frames [d]);
323
324
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
+ }
326
330
}
327
331
}
328
332
@@ -391,7 +395,14 @@ bool FrameBuffer::UpdateFrameInfoWithIncomingFrame(const FrameObject& frame,
391
395
// frames are inserted or decoded.
392
396
ref_info->second .dependent_frames [ref_info->second .num_dependent_frames ] =
393
397
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
+ }
395
406
}
396
407
RTC_DCHECK_LE (ref_info->second .num_missing_continuous ,
397
408
ref_info->second .num_missing_decodable );
0 commit comments