[mediaplayer] prevent bogus ImagePipe.AddImage calls

The video renderer needs to add images to its image pipe. It does
this when it has a stream type with non-zero height and width and
the input connection has VMOs available.

In some cases, the VMOs supplied by the input connection are out-
of-date with respect to the current image size. The correct VMOs
are supplied somewhat later. Because the renderer tries to use the
small VMOs, scenic complains bitterly in the logs. The situation is
corrected when the new VMOs show up, so there/s no lasting harm.

This CL prevents images from being added to the ImagePipe when the
VMOs are too small, so the scenic errors are not generated.

TEST: no behavior change (other than logs), tested for regression
Change-Id: I7239d70b9a9210fa8e190ba0605441f14d7fc40a
diff --git a/bin/mediaplayer/fidl/fidl_video_renderer.cc b/bin/mediaplayer/fidl/fidl_video_renderer.cc
index 9f5c7d1..f416939 100644
--- a/bin/mediaplayer/fidl/fidl_video_renderer.cc
+++ b/bin/mediaplayer/fidl/fidl_video_renderer.cc
@@ -338,6 +338,13 @@
   std::vector<fbl::RefPtr<PayloadVmo>> vmos = UseInputVmos().GetVmos();
   FXL_DCHECK(!vmos.empty());
 
+  if (vmos[0]->size() < image_info_.stride * image_info_.height) {
+    // The payload VMOs are too small for the images. We will be getting a new
+    // set of VMOs shortly, at which time |OnInputConnectionReady| will be
+    // called, and we'll he here again with good VMOs.
+    return;
+  }
+
   image_id_base_ = next_image_id_base_;
   next_image_id_base_ = image_id_base_ + vmos.size();