Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Unified Diff: ui/ozone/platform/dri/crtc_controller.cc

Issue 779173007: Fix crash when we don't have a plane to display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/ozone/platform/dri/overlay_plane.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/crtc_controller.cc
diff --git a/ui/ozone/platform/dri/crtc_controller.cc b/ui/ozone/platform/dri/crtc_controller.cc
index 44c88d68a1d99911bc1b954817442e41695127eb..a94ac18c2b0db65ce754a2390ce5aae2fea9377b 100644
--- a/ui/ozone/platform/dri/crtc_controller.cc
+++ b/ui/ozone/platform/dri/crtc_controller.cc
@@ -63,13 +63,17 @@ bool CrtcController::SchedulePageFlip(HardwareDisplayPlaneList* plane_list,
const OverlayPlaneList& overlays) {
DCHECK(!page_flip_pending_);
DCHECK(!is_disabled_);
- const OverlayPlane& primary = OverlayPlane::GetPrimaryPlane(overlays);
- DCHECK(primary.buffer.get());
+ const OverlayPlane* primary = OverlayPlane::GetPrimaryPlane(overlays);
+ if (!primary) {
+ LOG(ERROR) << "No primary plane to display on crtc " << crtc_;
+ return true;
+ }
+ DCHECK(primary->buffer.get());
- if (primary.buffer->GetSize() != gfx::Size(mode_.hdisplay, mode_.vdisplay)) {
+ if (primary->buffer->GetSize() != gfx::Size(mode_.hdisplay, mode_.vdisplay)) {
LOG(WARNING) << "Trying to pageflip a buffer with the wrong size. Expected "
<< mode_.hdisplay << "x" << mode_.vdisplay << " got "
- << primary.buffer->GetSize().ToString() << " for"
+ << primary->buffer->GetSize().ToString() << " for"
<< " crtc=" << crtc_ << " connector=" << connector_;
return true;
}
« no previous file with comments | « no previous file | ui/ozone/platform/dri/overlay_plane.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698