Bug 1158627 - WebRTC return error if GetEmptyFrame returns null. r=jesup, a=sledru
authorEthan Hugg <ethanhugg@gmail.com>
Sun, 26 Apr 2015 13:13:46 -0700
changeset 260317 f1cd36f7e0e1
parent 260316 cdfd06d73d17
child 260318 348c2ae68d50
push id746
push userryanvm@gmail.com
push date2015-04-28 22:47 +0000
treeherdermozilla-release@348c2ae68d50 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, sledru
bugs1158627
milestone38.0
Bug 1158627 - WebRTC return error if GetEmptyFrame returns null. r=jesup, a=sledru
media/webrtc/trunk/webrtc/modules/video_coding/main/source/jitter_buffer.cc
--- a/media/webrtc/trunk/webrtc/modules/video_coding/main/source/jitter_buffer.cc
+++ b/media/webrtc/trunk/webrtc/modules/video_coding/main/source/jitter_buffer.cc
@@ -655,18 +655,20 @@ VCMFrameBufferEnum VCMJitterBuffer::GetF
   // No match, return empty frame.
   *frame = GetEmptyFrame();
   VCMFrameBufferEnum ret = kNoError;
   if (!*frame) {
     // No free frame! Try to reclaim some...
     LOG(LS_WARNING) << "Unable to get empty frame; Recycling.";
     bool found_key_frame = RecycleFramesUntilKeyFrame();
     *frame = GetEmptyFrame();
-    assert(*frame);
-    if (!found_key_frame) {
+    if (!*frame) {
+      LOG(LS_ERROR) << "GetEmptyFrame returned NULL.";
+      return kGeneralError;
+    } else if (!found_key_frame) {
       ret = kFlushIndicator;
     }
   }
   (*frame)->Reset();
   return ret;
 }
 
 int64_t VCMJitterBuffer::LastPacketTime(const VCMEncodedFrame* frame,