diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-05-29 12:40:36 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-05-29 15:34:30 +0200 |
commit | 0adee3ac5080723b5f0605c13f02ef358d848a0b (patch) | |
tree | df6430414ad108a29b271b3d6d76f2bc53d64863 | |
parent | 061706c4b68e10b0ab265f52b77afcb1cfa74e5f (diff) |
crashtesting: failure on loading gnome635181-1.tiff
Change-Id: I5dd9552eb267ffb67aa0aae36b474eb28790b5c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135091
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/source/filter/itiff/itiff.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/vcl/source/filter/itiff/itiff.cxx b/vcl/source/filter/itiff/itiff.cxx index 59021b8c4999..6f81dffd08ef 100644 --- a/vcl/source/filter/itiff/itiff.cxx +++ b/vcl/source/filter/itiff/itiff.cxx @@ -120,7 +120,7 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& rGraphic) break; } - if (w > SAL_MAX_INT32 / 8 || h > SAL_MAX_INT32 / 8) + if (w > SAL_MAX_INT32 / 32 || h > SAL_MAX_INT32 / 32) { SAL_WARN("filter.tiff", "image too large"); break; @@ -147,10 +147,20 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& rGraphic) if (TIFFReadRGBAImageOriented(tif, w, h, raster.data(), ORIENTATION_TOPLEFT, 1)) { Bitmap bitmap(Size(w, h), vcl::PixelFormat::N24_BPP); - AlphaMask bitmapAlpha(Size(w, h)); - BitmapScopedWriteAccess access(bitmap); + if (!access) + { + SAL_WARN("filter.tiff", "cannot create image " << w << " x " << h); + break; + } + + AlphaMask bitmapAlpha(Size(w, h)); AlphaScopedWriteAccess accessAlpha(bitmapAlpha); + if (!accessAlpha) + { + SAL_WARN("filter.tiff", "cannot create alpha " << w << " x " << h); + break; + } /* ORIENTATION_TOPLEFT = 1 |