summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-02-07 16:20:54 +0000
committerAndras Timar <andras.timar@collabora.com>2018-03-06 15:09:43 +0100
commitf931af012e8651b5c3d82bb78fc3169f9bb944d2 (patch)
tree578302e7bf89b6b950820eed6fe5e42b080fba53 /vcl
parentdc8a20fbd2e18625d0d680051e16a31388e14495 (diff)
return early on short stream
Change-Id: Ia9cb4dec5358281322a2428c5f2153836a1ee1af Reviewed-on: https://gerrit.libreoffice.org/49375 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 43b1e91ec376ae69c843e576cf7352f085d356b6)
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/fontsubset/sft.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 14f0ec956b20..dd134305bc95 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -1535,6 +1535,8 @@ int OpenTTFontBuffer(const void* pBuffer, sal_uInt32 nLen, sal_uInt32 facenum, T
static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
{
+ if (t->fsize < 4)
+ return SF_TTFORMAT;
int i;
sal_uInt32 length, tag;
sal_uInt32 tdoffset = 0; /* offset to TableDirectory in a TTC file. For TTF files is 0 */