summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-02-07 16:20:54 +0000
committerMichael Stahl <mstahl@redhat.com>2018-02-08 13:28:02 +0100
commit96af996b06f980006414dedcecc96978f5a31779 (patch)
tree9fbd813383a8defeb4197456df103f6d74a91174 /vcl/source
parent2f8f0365c2846a755d4c1093ea85e0929b64b84d (diff)
return early on short stream
Change-Id: Ia9cb4dec5358281322a2428c5f2153836a1ee1af Reviewed-on: https://gerrit.libreoffice.org/49374 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'vcl/source')
-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 5c7929b76615..7c35d3207e0d 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -1521,6 +1521,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 */