Fix a widget size check bug in nsWindow::CaptureWidgetOnScreen. (bug 1173117 part 3, r=mattwoodrow)
authorDavid Anderson <danderson@mozilla.com>
Thu, 18 Jun 2015 13:42:42 -0700
changeset 267765 9266896a26d4009d46ea04dd5d3a184f596af89f
parent 267764 451e24d7ed64df2afbd669a7a9732f520f7e9a3f
child 267766 b0a391c7c14aa92ec14f9a56e46f5f4e2d65fc65
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-esr52@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1173117
milestone41.0a1
Fix a widget size check bug in nsWindow::CaptureWidgetOnScreen. (bug 1173117 part 3, r=mattwoodrow)
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -7598,17 +7598,17 @@ bool nsWindow::CaptureWidgetOnScreen(Ref
 
   HDC dc = ::GetDC(mWnd);
   uint32_t flags = (mTransparencyMode == eTransparencyOpaque)
                    ? 0
                    : gfxWindowsSurface::FLAG_IS_TRANSPARENT;
 
   nsRefPtr<gfxASurface> surf = new gfxWindowsSurface(dc, flags);
   IntSize size(surf->GetSize().width, surf->GetSize().height);
-  if (size.width < 0 || size.height < 0) {
+  if (size.width <= 0 || size.height <= 0) {
     ::ReleaseDC(mWnd, dc);
     return false;
   }
 
   RefPtr<DrawTarget> source = Factory::CreateDrawTargetForCairoSurface(surf->CairoSurface(), size);
   if (!source) {
     ::ReleaseDC(mWnd, dc);
     return false;