mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: cherry-pick b977dff8 from freetype (#26069)
Co-authored-by: Andrey Belenko <anbelen@microsoft.com>
This commit is contained in:
@@ -19,5 +19,7 @@
|
||||
|
||||
"src/electron/patches/ffmpeg": "src/third_party/ffmpeg",
|
||||
|
||||
"src/electron/patches/usrsctp": "src/third_party/usrsctp/usrsctplib"
|
||||
"src/electron/patches/usrsctp": "src/third_party/usrsctp/usrsctplib",
|
||||
|
||||
"src/electron/patches/freetype": "src/third_party/freetype/src"
|
||||
}
|
||||
|
||||
1
patches/freetype/.patches
Normal file
1
patches/freetype/.patches
Normal file
@@ -0,0 +1 @@
|
||||
test_early_to_prevent_overflow.patch
|
||||
39
patches/freetype/test_early_to_prevent_overflow.patch
Normal file
39
patches/freetype/test_early_to_prevent_overflow.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Andrey Belenko <anbelen@microsoft.com>
|
||||
Date: Tue, 20 Oct 2020 21:37:16 +0200
|
||||
Subject: Test early to prevent overflow.
|
||||
|
||||
Bug: chromium:1139963
|
||||
|
||||
diff --git a/src/sfnt/pngshim.c b/src/sfnt/pngshim.c
|
||||
index 523b30a745b6402e21043c68132d225f7833cef6..090b22afa8aecb7863c7772bfeac077ce1eb09ea 100644
|
||||
--- a/src/sfnt/pngshim.c
|
||||
+++ b/src/sfnt/pngshim.c
|
||||
@@ -328,6 +328,13 @@
|
||||
|
||||
if ( populate_map_and_metrics )
|
||||
{
|
||||
+ /* reject too large bitmaps similarly to the rasterizer */
|
||||
+ if ( imgWidth > 0x7FFF || imgHeight > 0x7FFF )
|
||||
+ {
|
||||
+ error = FT_THROW( Array_Too_Large );
|
||||
+ goto DestroyExit;
|
||||
+ }
|
||||
+
|
||||
metrics->width = (FT_UShort)imgWidth;
|
||||
metrics->height = (FT_UShort)imgHeight;
|
||||
|
||||
@@ -336,13 +343,6 @@
|
||||
map->pixel_mode = FT_PIXEL_MODE_BGRA;
|
||||
map->pitch = (int)( map->width * 4 );
|
||||
map->num_grays = 256;
|
||||
-
|
||||
- /* reject too large bitmaps similarly to the rasterizer */
|
||||
- if ( map->rows > 0x7FFF || map->width > 0x7FFF )
|
||||
- {
|
||||
- error = FT_THROW( Array_Too_Large );
|
||||
- goto DestroyExit;
|
||||
- }
|
||||
}
|
||||
|
||||
/* convert palette/gray image to rgb */
|
||||
Reference in New Issue
Block a user