From 7bec26bd36b2d11278938c4e136e97290b053e45 Mon Sep 17 00:00:00 2001 From: cxl Date: Wed, 9 Sep 2020 10:18:37 +0000 Subject: [PATCH] plugin/ppm: Fixed condition git-svn-id: svn://ultimatepp.org/upp/trunk@15001 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlCore/Win32Wnd.cpp | 4 ---- uppsrc/plugin/ppm/ppm.cpp | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/uppsrc/CtrlCore/Win32Wnd.cpp b/uppsrc/CtrlCore/Win32Wnd.cpp index c981d171e..effd90cad 100644 --- a/uppsrc/CtrlCore/Win32Wnd.cpp +++ b/uppsrc/CtrlCore/Win32Wnd.cpp @@ -1279,9 +1279,6 @@ Rect Ctrl::GetScreenClient(HWND hwnd) } Rect Ctrl::GetDefaultWindowRect() { -#ifdef PLATFORM_WINCE - return Rect(0, 0, 100, 100); -#else HWND hwnd = ::CreateWindow("UPP-CLASS-A", "", WS_OVERLAPPED, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, NULL); @@ -1294,7 +1291,6 @@ Rect Ctrl::GetDefaultWindowRect() { else sr = RectC(20, 20, 500, 350); return sr; -#endif } TopFrameDraw::TopFrameDraw(Ctrl *ctrl, const Rect& r) diff --git a/uppsrc/plugin/ppm/ppm.cpp b/uppsrc/plugin/ppm/ppm.cpp index b8237a03e..468e81a75 100644 --- a/uppsrc/plugin/ppm/ppm.cpp +++ b/uppsrc/plugin/ppm/ppm.cpp @@ -24,12 +24,12 @@ bool PPMRaster::Create() CParser p(h); size.cx = p.ReadInt(); size.cy = p.ReadInt(); - if(size.cx <= 0 && size.cx > 99999 || size.cy <= 0 || size.cy >= 99999) + if(size.cx <= 0 || size.cx > 99999 || size.cy <= 0 || size.cy >= 99999) return false; h = stream.GetLine(); CParser p1(h); int maxval = p1.ReadInt(); - if(maxval <= 0 && maxval > 65535) + if(maxval <= 0 || maxval > 65535) return false; is16 = maxval > 255; pixel_pos = stream.GetPos();