summaryrefslogtreecommitdiff
path: root/vcl/source/fontsubset
AgeCommit message (Collapse)Author
2018-02-09various sft fixesCaolán McNamara
use ptr diff rather than int (cherry picked from commit 5b426038a7befcaf0d05824ffb20200ff8833ad3) fix mem leak (cherry picked from commit 603cb6cf31a5212d03736a552770e5734b0e8066) check more table sizes (cherry picked from commit 1828490bb22f1c8273c4a9f5b1db819b173ca70d) check cmap offset (cherry picked from commit 683d9883ad8fd6568e6a7832e5bb347c1d043e4b) check tableoffset against size (cherry picked from commit ae73c3ff112e1ed38eb4678ac5745990661a2e66) check ntables offset (cherry picked from commit 75a171a405afd6eac236af93aa9d29a9c3ec9c64) use safeint on calculations (cherry picked from commit 139b6c6cf898467098f3a6f29fa84013a182285f) simplify returns (cherry picked from commit e8b2aad1cb2107304761e68aa380b5c29d8ef22f) extend to cover the last byte needed (cherry picked from commit c7b0117f26a386c98a721ff3897479c268103d74) bounds check (cherry picked from commit bb32616bdd6e3b327654bab0e1d790d8d50b893d) move largest bounds check to start (cherry picked from commit f832198e6a33052c7cc86b25843badfb962a2ae8) Change-Id: Ia174fd94c57cc3c899c10e1c0dc5968965a50427 0d329357ac282d4652b0f7ebc401cbd51963461b 004a6d322f60d916cc4635b362ce948e8a10d7c7 5aae26c38f3645020f0e1d6d7b6877c2727af1b4 a79be052dd3f6b6ed38fb326558924c853af5fff d75f5f4b578fd176c17e5763569f1403260c6594 c063786ba41aa9a985f505e62b43d3d543a0d48f 1a67cb2f1c686032438852fec1267a59fbd04d7f 5177d42b47a4bca614878dce4a69ab16b5cfe163 6d32a6b6f1dd91db42a3f154700ea55603f0e4dd 03fe80f9568759b829fac4e9bcfd496efebe6a26 Reviewed-on: https://gerrit.libreoffice.org/49484 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-02-09check O_hhea and O_vhea sizesCaolán McNamara
Change-Id: I82e47732815f0112801c8c3a3e5b0b09ac25610a Reviewed-on: https://gerrit.libreoffice.org/49438 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-02-09check O_head sizeCaolán McNamara
Change-Id: Idf5d30eaed0196cfa9266e35131c538c606a0960 Reviewed-on: https://gerrit.libreoffice.org/49365 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit b10ae2faae6f3c448bbab71585550387e18cc248) Reviewed-on: https://gerrit.libreoffice.org/49366 Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-02-09check table size before reading nglyphsCaolán McNamara
Change-Id: Ib511fdf16006877ca76085137eb9200601b2f8f7 Reviewed-on: https://gerrit.libreoffice.org/49363 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 08dd51bfcaa6b493e134bcc7787cc18c36ad5db1) Reviewed-on: https://gerrit.libreoffice.org/49435 Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-02-09Removed unused code for reading kern tableKhaled Hosny
Change-Id: I66b17dbee0a04e61b99e23933a7fed4be30f3a93 Reviewed-on: https://gerrit.libreoffice.org/49426 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org> (cherry picked from commit e3caecb5a33288dd46a80b2ffcc47a2288305052) Reviewed-on: https://gerrit.libreoffice.org/49451 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-08return early on short streamCaolán McNamara
Change-Id: Ia9cb4dec5358281322a2428c5f2153836a1ee1af Reviewed-on: https://gerrit.libreoffice.org/49374 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-02-08stay within font boundsCaolán McNamara
Change-Id: Ie8ed610b71cb1b20963827c2be97155d2d8aa22c Reviewed-on: https://gerrit.libreoffice.org/49370 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-02-08what matters is the availability of the last element, not the firstCaolán McNamara
Change-Id: I23d3abdbe62b735d66261fb337613da88cc4206b Reviewed-on: https://gerrit.libreoffice.org/49379 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-02-08check kern table sizeCaolán McNamara
Change-Id: I65b5f0a8950d54c00d6fd7c385ca1c5dca2ef2c8 Reviewed-on: https://gerrit.libreoffice.org/49383 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-02-07sanity check cmap table sizeCaolán McNamara
Change-Id: I010c2fd221bcd86a62efd9996a0c34930828cb6d Reviewed-on: https://gerrit.libreoffice.org/49349 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-01-09tdf#114704 use of float as intermediate causes out by one on large offsetsCaolán McNamara
table offset integer value of 21281769 is correctly read, but on cast to float it is represented as 21281768 and we're off by one when cast back to integer later Change-Id: I5694e14d72c04493ba15cc77485a734498a45468 Reviewed-on: https://gerrit.libreoffice.org/47608 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-11-03loplugin:constparam in vcl,svtoolsNoel Grandin
Change-Id: I7a3eb2bfda869e9e66db919f929ead60cf8890a4 Reviewed-on: https://gerrit.libreoffice.org/44209 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-02improve constparam lopluginNoel Grandin
lots of little fixes to make the logic less pessimistic Change-Id: If368822984250b11b98c56f5890177a1402e8660 Reviewed-on: https://gerrit.libreoffice.org/44168 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-30loplugin:constantparam in vclNoel Grandin
Change-Id: Ic32e4098dcdae5ca5d7fe2749badedabda86a90d Reviewed-on: https://gerrit.libreoffice.org/44043 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23loplugin:includeform: vclStephan Bergmann
Change-Id: Id7dea3917740aaf4db8dada5e2bea6e117d714ea
2017-10-13tdf#107605: Fix reading version 0 OS/2 font tableKhaled Hosny
The version 0 table os exactly 78 bytes since it does not have any of the extra fields from the later versions. Change-Id: Ie2e478bdefb201b988dc0844240d4ff193d66583 Reviewed-on: https://gerrit.libreoffice.org/43374 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2017-10-05loplugin:finalclasses in vclNoel Grandin
Change-Id: I7de9cd6c5569217aa8d379c6d112cd1874bca8e2 Reviewed-on: https://gerrit.libreoffice.org/43151 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-14clang-tidy modernize-use-emplace in vclNoel Grandin
Change-Id: Ie0a6d105b0167431275e628935df4f4c1a36d070 Reviewed-on: https://gerrit.libreoffice.org/42259 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-05rename GetTTFontMterics -> GetTTFontMetricsNoel Grandin
Change-Id: I9952ddf0b1256e768a664f4da70455245cf67f41 Reviewed-on: https://gerrit.libreoffice.org/41934 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins <ci@libreoffice.org>
2017-08-31loplugin:constparams: vcl (macOS)Stephan Bergmann
Change-Id: I993ab0021d0a0bee8e78975bba180355d2bfb19c
2017-07-31loplugin:oncevarNoel Grandin
extend oncevar to any POD type Change-Id: Ia98ee0a67f183e40fb0c38477760124b2c411dc0 Reviewed-on: https://gerrit.libreoffice.org/40564 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-18loplugin:constparams in vclNoel Grandin
Change-Id: I36afe2107e07ffb9b73c0b76be600e3e999a0fd4 Reviewed-on: https://gerrit.libreoffice.org/40116 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-12strip some linefeeds from the end of debug outputNoel Grandin
Change-Id: I2821969d86b7f8cee53404e6a0acfbebbe53b3ac Reviewed-on: https://gerrit.libreoffice.org/39824 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-10teach unnecessaryparen loplugin about identifiersNoel Grandin
Change-Id: I5710b51e53779c222cec0bf08cd34bda330fec4b Reviewed-on: https://gerrit.libreoffice.org/39737 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-02loplugin:casttovoid: vclStephan Bergmann
Change-Id: Icdc9d009849f2a93f6e1dbba07b1042dbb1ff561
2017-06-30loplugin:unusedfields in toolkit..xmloffNoel Grandin
Change-Id: I4964ff97e0a1735dc08c6ad204cae0b08e9ffc2c Reviewed-on: https://gerrit.libreoffice.org/39406 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-28loplugin:oncevar in vclNoel Grandin
Change-Id: I37a6dacda12e1c2910737d74aa344c7e2e195aeb Reviewed-on: https://gerrit.libreoffice.org/39328 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-19Avoid -fsanitize=shift-base about left-shift of negative valuesStephan Bergmann
...assuming these values are indeed intended to be negative (and <https: //developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6.html#Types>) mentions a "Fixed: 16.16-bit sgined fixed-point number" type, apparently represented here by F16Dot16, so the assumption looks plausible). During CppunitTest_vcl_pdfexport, encountered negative values -1184 and -22 with instdir/share/fonts/truetype/Carlito-Regular.ttf and -8 with instdir/share/fonts/truetype/LiberationSans-Bold.ttf. Change-Id: Ia07c61aebc2c9c67d0ed6173ecac94bab2abb2a8
2017-06-17loplugin:unusedfields in vcl part3Noel Grandin
Change-Id: I5a6319ba1667af6e9b7b92c22f858188c28c4c61 Reviewed-on: https://gerrit.libreoffice.org/38835 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-17loplugin:unusedfields in vcl part2Noel Grandin
Change-Id: Icd02f63e9738c0bb91348e2084649f9edc281e67 Reviewed-on: https://gerrit.libreoffice.org/38833 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-14use more SAL_N_ELEMENTS part 1Noel Grandin
- teach comphelper::containerToSequence to handle sized arrays - also use range based for-loop where appropriate. Change-Id: I73ba9b6295e7b29c872ee53de7a9340969e07f99 Reviewed-on: https://gerrit.libreoffice.org/38769 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-09clang-tidy readability-non-const-parameterNoel Grandin
Change-Id: I7b2680898dbfc49185fb949349d81f4ac615a470 Reviewed-on: https://gerrit.libreoffice.org/38593 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-31clang-tidy readability-redundant-control-flowNoel Grandin
Change-Id: I832f7ef0f1bd55e365db7e49823fe8bc30390c04 Reviewed-on: https://gerrit.libreoffice.org/38215 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-08cleanup tools/debug.hxx includesJochen Nitschke
with command > git grep -l tools/debug.hxx | xargs grep -L DBG_ | xargs sed -i '/#include *\(<\|\"\)tools\/debug.hxx.*/d' don't change files in includes/ and */pch Change-Id: Ie429d6a7dca5dfa1073e0f5ba037f7c84bdbec08 Reviewed-on: https://gerrit.libreoffice.org/37349 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-26use strong_int for LanguageTypeNoel Grandin
Change-Id: If99a944f7032180355da291ad283b4cfcea4f448 Reviewed-on: https://gerrit.libreoffice.org/36629 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-31tdf#82580 tools: rename Rectangle to tools::RectangleMiklos Vajna
Mostly generated using make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle" Except some modules have their own foo::tools namespace, so there have to use ::tools::Rectangle. This commit just moves the class from the global namespace, it does not update pre/postwin.h yet. Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2 Reviewed-on: https://gerrit.libreoffice.org/35923 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-03-08loplugin:loopvartoosmallStephan Bergmann
Change-Id: Ie173849c0956edf9fd111120fa4bdfb2930ab69f
2017-02-21loplugin:unusedmethodsNoel Grandin
Change-Id: I52a9f16f3ed543a3c83ca111df70e3f7ae1ef33c Reviewed-on: https://gerrit.libreoffice.org/34508 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-20IGNORE_HINTS have never been definedKhaled Hosny
Change-Id: I35d08f6ff1ff3e78a5078062cef89304fa782489
2017-02-09convert FontType to scoped enumNoel Grandin
Change-Id: Ieb8f90be8effde5f25bc872784c3ea2177b14bf9 Reviewed-on: https://gerrit.libreoffice.org/34056 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-08drop unused enum TTCreationFlagsNoel Grandin
there is only one method using it, and all of the call sites pass 0 Change-Id: I5d71b36cf890fbcf0be9d795756da0cfd61ae309 Reviewed-on: https://gerrit.libreoffice.org/34024 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-08coverity#707560 Uninitialized scalar variableCaolán McNamara
Change-Id: Ia041c86a689f92795298ee16922ab42734820ec6
2017-02-06loplugin:unusedenumconstants in vclNoel Grandin
- drop TTCR_GLYPHSEQ - drop ImageType::Invalid - give preedit_data_t a default constructor, so my plugin spots that the eState field is being initalised to DontKnow effectively by a memset - document ToolbarIconSize::Small as unused, but can't remove since it might be stored in a user-setting somewhere Change-Id: I94b34bba83a04de16f95e4faec95b4bd29f3c652 Reviewed-on: https://gerrit.libreoffice.org/33887 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-27loplugin: unnecessary destructor vbahelper..vclNoel Grandin
Change-Id: I6b7800d4a456391251168f7923a1ec7a5ca9efc9 Reviewed-on: https://gerrit.libreoffice.org/33577 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-10-Werror=format=Stephan Bergmann
Change-Id: I690117e6e94af2364cbf2f7bcb0bc44adc264567
2017-01-10New loplugin:conststringvar: vclStephan Bergmann
Change-Id: I573c19e4a2f6ee041998216ea4cf29677986d731
2017-01-06New loplugin:charrightshiftStephan Bergmann
Change-Id: Ib645fb11004bc0fe05c9c416ae72b0ae56c23a15
2016-12-23loplugin:unusedmethodsNoel Grandin
Change-Id: Ife4c8d948ffa116f044d43903de9485e43cfcae5 Reviewed-on: https://gerrit.libreoffice.org/32336 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-01Unused codeKhaled Hosny
Change-Id: Idfc964930c242d752a78cd109d75d809bce4de11 Reviewed-on: https://gerrit.libreoffice.org/31470 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-30More dead codeKhaled Hosny
Change-Id: I820ed3905d18801513b14f535042801023be5538 Reviewed-on: https://gerrit.libreoffice.org/31387 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>