diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/itiff/itiff.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/vcl/source/filter/itiff/itiff.cxx b/vcl/source/filter/itiff/itiff.cxx index 3e308f3019d3..ed74d00ddeb9 100644 --- a/vcl/source/filter/itiff/itiff.cxx +++ b/vcl/source/filter/itiff/itiff.cxx @@ -184,6 +184,25 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& rGraphic) } } } + + uint16_t Compression; + if (TIFFGetField(tif, TIFFTAG_COMPRESSION, &Compression) == 1) + { + if (Compression == COMPRESSION_CCITTFAX4) + { + if (TIFFIsTiled(tif)) + { + uint32_t tw; + if (TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tw) == 1) + { + uint32_t DspRuns; + bOk = !o3tl::checked_multiply(tw, static_cast<uint32_t>(4), DspRuns) && DspRuns < MAX_PIXEL_SIZE; + SAL_WARN_IF(!bOk, "filter.tiff", "skipping oversized tiff tile width: " << tw); + } + } + } + } + } if (!bOk) |