mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-30 13:24:19 +00:00
Prevent loading of too large PNG images
This commit is contained in:
parent
8e5c4b6f7a
commit
13c4c605b3
1 changed files with 1 additions and 0 deletions
|
|
@ -284,6 +284,7 @@ handle_add_command(GraphicsManager *self, const GraphicsCommand *g, const uint8_
|
|||
switch(fmt) {
|
||||
case PNG:
|
||||
if (!g->data_sz) ABRT(EINVAL, "Must provide a data size with the PNG format");
|
||||
if (g->data_sz > 4 * 100000000) ABRT(EINVAL, "PNG data size too large");
|
||||
img->load_data.is_4byte_aligned = true;
|
||||
img->load_data.data_sz = g->data_sz;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue