aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-11-18 23:07:34 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-11-18 23:07:34 +0000
commit2776c4d1b7d598e98fa38e2a5924e0a8b1d67c6f (patch)
tree8274228d6bc2dd68afbe3e366fd27a6efb3a8313
parentdad08fc5667b0a40923ca45c654bd6cb425ccc68 (diff)
parent358c238408a1fdc357d9afef6811369a7701e004 (diff)
downloadfreetype-android11-qpr1-d-release.tar.gz
Merge cherrypicks of [13083487, 13083717, 13083430, 13083574, 13083546, 13083737, 13083756, 13083777, 13083779, 13083758, 13083548, 13083531, 13083718, 13083781, 13083738, 13083550, 13083740, 13083743, 13083591, 13083592, 13083595, 13083817, 13083819, 13083821, 13083823, 13083825, 13083826, 13083829, 13083551, 13083761, 13083763, 13083765, 13083783, 13083785, 13083833, 13083786, 13083767, 13083856, 13083744, 13083876, 13083721, 13083490, 13083492, 13083273, 13083860, 13083896] into rvc-qpr1-d-releaseandroid-11.0.0_r31android-11.0.0_r28android11-qpr1-d-release
Change-Id: I0c7728f8c0686d7ad2ec0f803fe80714ab3b0f15
-rw-r--r--src/sfnt/pngshim.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/sfnt/pngshim.c b/src/sfnt/pngshim.c
index ca85d9751..15f4e1631 100644
--- a/src/sfnt/pngshim.c
+++ b/src/sfnt/pngshim.c
@@ -327,6 +327,13 @@
if ( populate_map_and_metrics )
{
+ /* reject too large bitmaps similarly to the rasterizer */
+ if ( imgHeight > 0x7FFF || imgWidth > 0x7FFF )
+ {
+ error = FT_THROW( Array_Too_Large );
+ goto DestroyExit;
+ }
+
metrics->width = (FT_UShort)imgWidth;
metrics->height = (FT_UShort)imgHeight;
@@ -335,13 +342,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 */