Fix test FrameGenerator to work with a single file source

Bug: None
Change-Id: I645779379145c6c7b2d452dc1a15f9d9b97a3ee5
Reviewed-on: https://webrtc-review.googlesource.com/c/121641
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26567}
diff --git a/test/frame_generator.cc b/test/frame_generator.cc
index 8daeb71..453270e 100644
--- a/test/frame_generator.cc
+++ b/test/frame_generator.cc
@@ -382,7 +382,8 @@
   }
 
   void UpdateSourceFrame(size_t frame_num) {
-    while (current_frame_num_ != frame_num) {
+    while (current_frame_num_ != frame_num ||
+           current_source_frame_ == nullptr) {
       current_source_frame_ = file_generator_.NextFrame();
       current_frame_num_ = (current_frame_num_ + 1) % num_frames_;
     }