From 92664a81aea6c150e219a1cf4b9a98d27cdd547b Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Tue, 4 Oct 2016 09:53:59 +0200 Subject: vcl: remove artificial image byte size limit in JPEG filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Tomaž Vajngerl --- vcl/source/filter/jpeg/JpegReader.cxx | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'vcl/source') 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 ); -- cgit