From: Firefly <service@t-firefly.com>
Date: Mon, 30 Nov 2015 15:04:59 -0800
Subject: [PATCH] Avoid integer overflows in parsing fonts
A malformed TTF can cause size calculations to overflow. This patch
checks the maximum reasonable value so that the total size fits in 32
bits. It also adds some explicit casting to avoid possible technical
undefined behavior when parsing sized unsigned values.
Bug: 25645298
Change-Id: Id4716132041a6f4f1fbb73ec4e445391cf7d9616
(cherry picked from commit 183c9ec2800baa2ce099ee260c6cbc6121cf1274)
(cherry picked from commit 6299a6ba13906c695f7a4f6748f7bc5856a110e5)
Signed-off-by: Firefly <service@t-firefly.com>