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 249672 9266896a26d4009d46ea04dd5d3a184f596af89f
parent 249671 451e24d7ed64df2afbd669a7a9732f520f7e9a3f
child 249673 b0a391c7c14aa92ec14f9a56e46f5f4e2d65fc65
push id28936
push userryanvm@gmail.com
push dateFri, 19 Jun 2015 20:34:42 +0000
treeherdermozilla-central@c319f262ce3e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1173117
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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;