[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - vcl/source

Caolán McNamara caolanm at redhat.com
Tue Jan 28 08:55:37 PST 2014


 vcl/source/filter/jpeg/JpegReader.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 622d57e9e33a63849f0a472c0cb3e94513f784c0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jan 27 15:05:33 2014 +0000

    Resolves: fdo#74051 support 8430x11700 jpegs
    
    Change-Id: I1ca95a496bca80e5e2787af2ccbf0f6cd42455a5
    (cherry picked from commit 53c803004554a3a0fff26501357a183bba008a26)
    Reviewed-on: https://gerrit.libreoffice.org/7697
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/vcl/source/filter/jpeg/JpegReader.cxx b/vcl/source/filter/jpeg/JpegReader.cxx
index c139471..86f9dc6 100644
--- a/vcl/source/filter/jpeg/JpegReader.cxx
+++ b/vcl/source/filter/jpeg/JpegReader.cxx
@@ -36,11 +36,11 @@ extern "C"
 #define JPEG_MIN_READ 512
 #define BUFFER_SIZE  4096
 namespace {
-    // Arbitrary maximal size (256M) of bitmaps after they have been decoded.
+    // 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(256 * 1024 * 1024);
+    static const sal_uInt64 MAX_BITMAP_BYTE_SIZE = sal_uInt64(512 * 1024 * 1024);
 }
 
 extern "C" void* CreateBitmapFromJPEGReader( void* pJPEGReader, void* pJPEGCreateBitmapParam )
@@ -235,7 +235,7 @@ void* JPEGReader::CreateBitmap( void* _pParam )
 
     sal_uInt64 nSize = aSize.Width();
     nSize *= aSize.Height();
-    if (nSize > SAL_MAX_INT32 / 24)
+    if (nSize > SAL_MAX_INT32 / (bGray?1:3))
         return NULL;
 
     // Check if the bitmap is untypically large.


More information about the Libreoffice-commits mailing list