diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2016-10-04 09:53:59 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2016-10-04 15:30:52 +0000 |
commit | 92664a81aea6c150e219a1cf4b9a98d27cdd547b (patch) | |
tree | 74e1e11136794d1172c1bb365f45c62ee84c4914 /vcl | |
parent | bef47d3da6f44b725519f7bf3e2400a3148bac67 (diff) |
vcl: remove artificial image byte size limit in JPEG filter
When reading a JPEG image we limit the image raw byte size to a
certain arbitrary value. This is not necessary and does not need
to be enforced.
Change-Id: Ia86ac2423f51a79eecf39d6afc0c81bb9b6ad1f1
Reviewed-on: https://gerrit.libreoffice.org/29521
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/jpeg/JpegReader.cxx | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/vcl/source/filter/jpeg/JpegReader.cxx b/vcl/source/filter/jpeg/JpegReader.cxx index cd00518dcf44..b1582d8da2b6 100644 --- a/vcl/source/filter/jpeg/JpegReader.cxx +++ b/vcl/source/filter/jpeg/JpegReader.cxx @@ -32,13 +32,6 @@ #define JPEG_MIN_READ 512 #define BUFFER_SIZE 4096 -namespace { - // Arbitrary maximal size (512M) of a bitmap after it has been decoded. - // It is used to prevent excessive swapping due to large buffers in - // virtual memory. - // May have to be tuned if it turns out to be too large or too small. - static const sal_uInt64 MAX_BITMAP_BYTE_SIZE = sal_uInt64(512 * 1024 * 1024); -} /* Expanded data source object for stdio input */ @@ -208,14 +201,6 @@ bool JPEGReader::CreateBitmap(JPEGCreateBitmapParam& rParam) if (nSize > SAL_MAX_INT32 / (bGray?1:3)) return false; - // Check if the bitmap is atypically large. - if (nSize*(bGray?1:3) > MAX_BITMAP_BYTE_SIZE) - { - // Do not try to acquire resources for the large bitmap or to - // read the bitmap into memory. - return false; - } - if( bGray ) { BitmapPalette aGrayPal( 256 ); |