mirror of
https://github.com/flatpak/flatpak.git
synced 2026-05-04 14:09:09 -04:00
icon-validator: Don't check SVG size
The size is just a number, but the resulting GdkPixbuf could still be quite big compared to the amount of data we're processing, so keep 4096x4096 as maximum dimensions. Closes: #2747 Approved by: alexlarsson
This commit is contained in:
committed by
Atomic Bot
parent
8008fe38a1
commit
32c5b15326
@@ -49,18 +49,26 @@ validate_icon (const char *arg_width,
|
||||
return 1;
|
||||
}
|
||||
|
||||
max_width = g_ascii_strtoll (arg_width, NULL, 10);
|
||||
if (max_width < 16 || max_width > 4096)
|
||||
if (!g_str_equal (name, "svg"))
|
||||
{
|
||||
g_printerr ("Bad width limit: %s\n", arg_width);
|
||||
return 1;
|
||||
}
|
||||
max_width = g_ascii_strtoll (arg_width, NULL, 10);
|
||||
if (max_width < 16 || max_width > 4096)
|
||||
{
|
||||
g_printerr ("Bad width limit: %s\n", arg_width);
|
||||
return 1;
|
||||
}
|
||||
|
||||
max_height = g_ascii_strtoll (arg_height, NULL, 10);
|
||||
if (max_height < 16 || max_height > 4096)
|
||||
max_height = g_ascii_strtoll (arg_height, NULL, 10);
|
||||
if (max_height < 16 || max_height > 4096)
|
||||
{
|
||||
g_printerr ("Bad height limit: %s\n", arg_height);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
g_printerr ("Bad height limit: %s\n", arg_height);
|
||||
return 1;
|
||||
/* Sanity check for vector files */
|
||||
max_height = max_width = 4096;
|
||||
}
|
||||
|
||||
if (width > max_width || height > max_height)
|
||||
|
||||
Reference in New Issue
Block a user