From: Jihoon Kim Date: Tue, 22 Dec 2015 01:02:19 +0000 (+0900) Subject: Check negative return value of 'SclResParserManager::get_layout_id' X-Git-Tag: accepted/tizen/mobile/20151222.023829~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F93%2F55093%2F1;p=platform%2Fcore%2Fuifw%2Flibscl-ui.git Check negative return value of 'SclResParserManager::get_layout_id' Change-Id: Id19cffe49ec5b0e6a34c4d9a5f0559e2127f6b3d --- diff --git a/scl/scluibuilder.cpp b/scl/scluibuilder.cpp index c308387..d5ddf27 100644 --- a/scl/scluibuilder.cpp +++ b/scl/scluibuilder.cpp @@ -98,7 +98,7 @@ CSCLUIBuilder::init(sclwindow parent) } layout = sclres_manager->get_layout_id(sclres_input_mode_configure[mode].layouts[display_mode]); - if (!scl_check_arrindex_unsigned(layout, MAX_SCL_LAYOUT) || + if (layout < 0 || !scl_check_arrindex_unsigned(layout, MAX_SCL_LAYOUT) || !scl_check_arrindex_unsigned(layout, sclres_manager->get_layout_size())) { layout = 0; } diff --git a/scl/scluiimpl.cpp b/scl/scluiimpl.cpp index 8385cd7..90f34ea 100644 --- a/scl/scluiimpl.cpp +++ b/scl/scluiimpl.cpp @@ -777,8 +777,10 @@ CSCLUIImpl::get_input_mode_size(const sclchar *input_mode, SCLDisplayMode displa sclint layout = sclres_manager->get_layout_id( sclres_input_mode_configure[inputmode].layouts[display_mode]); - ret.width = sclres_layout[layout].width; - ret.height = sclres_layout[layout].height; + if (layout >= 0) { + ret.width = sclres_layout[layout].width; + ret.height = sclres_layout[layout].height; + } } } } @@ -800,8 +802,6 @@ CSCLUIImpl::get_screen_resolution(sclint *width, sclint *height) } } - - void CSCLUIImpl::set_debug_mode(SCLDebugMode mode) {