From 31b70fe2779e6f603889b0470e662814c68696c3 Mon Sep 17 00:00:00 2001 From: lltcggie Date: Wed, 3 Jun 2015 04:33:41 +0900 Subject: [PATCH] =?UTF-8?q?GUI=E3=81=A7=E5=85=A5=E5=8A=9B=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=9F=E5=A4=89=E6=95=B0=E3=81=AE=E5=88=B6=E7=B4=84?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=82=92?= =?UTF-8?q?=E5=BC=B7=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- waifu2x-caffe-gui/Source.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/waifu2x-caffe-gui/Source.cpp b/waifu2x-caffe-gui/Source.cpp index e3660e9..45828d1 100644 --- a/waifu2x-caffe-gui/Source.cpp +++ b/waifu2x-caffe-gui/Source.cpp @@ -147,7 +147,7 @@ private: char *ptr = nullptr; scale_ratio = strtod(buf, &ptr); - if (!ptr || *ptr != '\0') + if (!ptr || *ptr != '\0' || scale_ratio <= 0.0) { scale_ratio = 2.0; ret = false; @@ -186,7 +186,7 @@ private: char *ptr = nullptr; crop_size = strtol (buf, &ptr, 10); - if (!ptr || *ptr != '\0') + if (!ptr || *ptr != '\0' || crop_size <= 0) { crop_size = 128; ret = false;