vcl/source/fontsubset/sft.cxx | 2 ++ 1 file changed, 2 insertions(+) New commits: commit 43b1e91ec376ae69c843e576cf7352f085d356b6 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Feb 7 16:20:54 2018 +0000
return early on short stream Change-Id: Ia9cb4dec5358281322a2428c5f2153836a1ee1af Reviewed-on: https://gerrit.libreoffice.org/49375 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Michael Stahl <mst...@redhat.com> diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index 37a1b14bfc6b..966393fa4fe3 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -1534,6 +1534,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 */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits