Fixed r5373-related regressions in VideoFramesQueue::FrameToRecord()

R=henrike@webrtc.org, stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/20389004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6018 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/utility/source/video_frames_queue.cc b/webrtc/modules/utility/source/video_frames_queue.cc
index fbcbd2c..63afbe9 100644
--- a/webrtc/modules/utility/source/video_frames_queue.cc
+++ b/webrtc/modules/utility/source/video_frames_queue.cc
@@ -80,8 +80,10 @@
       // List is traversed beginning to end. If ptrRenderFrame is not
       // NULL it must be the first, and thus oldest, VideoFrame in the
       // queue. It can be recycled.
-      ReturnFrame(ptrRenderFrame);
-      iter = _incomingFrames.erase(iter);
+      if (ptrRenderFrame) {
+        ReturnFrame(ptrRenderFrame);
+       _incomingFrames.pop_front();
+      }
       ptrRenderFrame = ptrOldestFrameInList;
     } else {
       // All VideoFrames following this one will be even newer. No match