From be4f9cabd26b4ea4c53e7ba7904ac70f5c7cc5f0 Mon Sep 17 00:00:00 2001 From: jfroy Date: Tue, 8 Sep 2015 13:48:00 -0700 Subject: [PATCH] Avoid rendering the performance overlay on unmappable video frames BUG=529376 Review URL: https://codereview.chromium.org/1330833002 Cr-Commit-Position: refs/heads/master@{#347783} --- media/cast/sender/performance_metrics_overlay.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/media/cast/sender/performance_metrics_overlay.cc b/media/cast/sender/performance_metrics_overlay.cc index 5b7c7147ee0d..f3086247b368 100644 --- a/media/cast/sender/performance_metrics_overlay.cc +++ b/media/cast/sender/performance_metrics_overlay.cc @@ -217,6 +217,12 @@ void MaybeRenderPerformanceMetricsOverlay(int target_bitrate, return; } + // Can't render to unmappable memory (DmaBuf, CVPixelBuffer). + if (!frame->IsMappable()) { + DVLOG(2) << "Cannot render overlay: frame uses unmappable memory."; + return; + } + // Compute the physical pixel top row for the bottom-most line of text. const int line_height = (kCharacterHeight + kLineSpacing) * kScale; int top = frame->visible_rect().height() - line_height; -- 2.11.4.GIT