mirror of
https://github.com/IgorTimofeev/MineOS.git
synced 2026-01-07 19:52:40 +01:00
Проверка на сигнатуру все же нужна
This commit is contained in:
parent
6eed533942
commit
97d3bd3cf3
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user