From 97d3bd3cf39cdaafedcba41b1b7404a5cca52f2a Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Sun, 11 Mar 2018 15:34:01 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BD=D0=B0=20=D1=81=D0=B8=D0=B3=D0=BD=D0=B0=D1=82?= =?UTF-8?q?=D1=83=D1=80=D1=83=20=D0=B2=D1=81=D0=B5=20=D0=B6=D0=B5=20=D0=BD?= =?UTF-8?q?=D1=83=D0=B6=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Applications/AppMarket/Main.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Applications/AppMarket/Main.lua b/Applications/AppMarket/Main.lua index e44c27ac..a65834a5 100644 --- a/Applications/AppMarket/Main.lua +++ b/Applications/AppMarket/Main.lua @@ -243,15 +243,20 @@ local function checkImage(url, mneTolkoSprosit) data = data .. chunk if needCheck and #data > 8 then if data:sub(1, 4) == "OCIF" then - if string.byte(data:sub(6, 6)) <= 8 and string.byte(data:sub(7, 7)) <= 4 then - if mneTolkoSprosit then + if string.byte(data:sub(5, 5)) == 6 then + if string.byte(data:sub(6, 6)) == 8 and string.byte(data:sub(7, 7)) == 4 then + if mneTolkoSprosit then + handle:close() + return true + end + needCheck = false + else handle:close() - return true + return false, "Image size is larger than 8x4" end - needCheck = false else handle:close() - return false, "Image size is larger than 8x4" + return false, "Image encoding method is not supported" end else handle:close() @@ -260,6 +265,7 @@ local function checkImage(url, mneTolkoSprosit) end else handle:close() + if reason then return false, reason else