diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-07 16:20:54 +0000 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2019-08-27 14:12:28 +0200 |
commit | a88c5fc8830698e7f6b25c247f70f60ef1c8c494 (patch) | |
tree | 0ee0457e671018c92632378ecb6cf2eb82ffec53 | |
parent | stay within font bounds (diff) | |
download | core-a88c5fc8830698e7f6b25c247f70f60ef1c8c494.tar.gz core-a88c5fc8830698e7f6b25c247f70f60ef1c8c494.zip |
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>
-rw-r--r-- | vcl/source/fontsubset/sft.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index cc4893216d3d..0e0978b779c0 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -1548,6 +1548,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 */ |