[Libreoffice-commits] core.git: vcl/source

Caolán McNamara caolanm at redhat.com
Fri Mar 10 15:56:05 UTC 2017


 vcl/source/filter/jpeg/JpegReader.cxx |   19 -------------------
 1 file changed, 19 deletions(-)

New commits:
commit 14cdcd154e9621ffdc4e00af7bc84b56d76d6cd4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 10 15:54:32 2017 +0000

    min valid jpeg len is less than 512
    
    our qa tests already include such, so this isn't right
    
    Change-Id: I86fb02bf353fb5b228db915f04db6e36cfb40c51

diff --git a/vcl/source/filter/jpeg/JpegReader.cxx b/vcl/source/filter/jpeg/JpegReader.cxx
index 7490cb3..ad67332 100644
--- a/vcl/source/filter/jpeg/JpegReader.cxx
+++ b/vcl/source/filter/jpeg/JpegReader.cxx
@@ -30,7 +30,6 @@
 #include <tools/fract.hxx>
 #include <memory>
 
-#define JPEG_MIN_READ 512
 #define BUFFER_SIZE  4096
 
 /*
@@ -275,24 +274,6 @@ ReadState JPEGReader::Read( Graphic& rGraphic )
 {
     ReadState   eReadState;
     bool        bRet = false;
-    sal_uInt8   cDummy;
-
-    // TODO: is it possible to get rid of this seek to the end?
-    // check if the stream's end is already available
-    mrStream.Seek( STREAM_SEEK_TO_END );
-    mrStream.ReadUChar( cDummy );
-    long nEndPosition = mrStream.Tell();
-
-    // else check if at least JPEG_MIN_READ bytes can be read
-    if( mrStream.GetError() == ERRCODE_IO_PENDING )
-    {
-        mrStream.ResetError();
-        if( ( nEndPosition  - mnFormerPos ) < JPEG_MIN_READ )
-        {
-            mrStream.Seek( mnLastPos );
-            return JPEGREAD_NEED_MORE;
-        }
-    }
 
     // seek back to the original position
     mrStream.Seek( mnLastPos );


More information about the Libreoffice-commits mailing list