[VP9 decoder] react to incorrect pixel format in the bitstream

Bug: chromium:1063490
Change-Id: Ibac3b43b42c1b088b6ac94ae327f23b11d3fd259
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171225
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30855}
diff --git a/modules/video_coding/codecs/vp9/vp9_impl.cc b/modules/video_coding/codecs/vp9/vp9_impl.cc
index 3b928f1..99d1abe 100644
--- a/modules/video_coding/codecs/vp9/vp9_impl.cc
+++ b/modules/video_coding/codecs/vp9/vp9_impl.cc
@@ -1764,6 +1764,11 @@
             // frame buffer is through a callback function. This is where we
             // should release |img_buffer|.
             rtc::KeepRefUntilDone(img_buffer));
+      } else {
+        RTC_LOG(LS_ERROR)
+            << "Unsupported pixel format produced by the decoder: "
+            << static_cast<int>(img->fmt);
+        return WEBRTC_VIDEO_CODEC_NO_OUTPUT;
       }
       break;
     case 10: