From 08d15ad6c38a15444044204dabb2a7f29e6550d8 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 7 Feb 2018 16:20:54 +0000 Subject: return early on short stream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia9cb4dec5358281322a2428c5f2153836a1ee1af Reviewed-on: https://gerrit.libreoffice.org/49373 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- vcl/source/fontsubset/sft.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'vcl/source/fontsubset') diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index 3071bd5dee1c..1b77d7ec7142 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 */ -- cgit