[poppler] poppler/DCTStream.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Mar 8 04:43:10 PDT 2009


 poppler/DCTStream.cc |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 6a6b3cc91053e771a67dffa979076d130f87ff11
Author: Ryszard Trojnacki <rysiek at menel.com>
Date:   Sun Mar 8 12:38:42 2009 +0100

    set up the error-manager before calling jpeg_create_decompress
    
    Bug #20484

diff --git a/poppler/DCTStream.cc b/poppler/DCTStream.cc
index 3343342..01a5e73 100644
--- a/poppler/DCTStream.cc
+++ b/poppler/DCTStream.cc
@@ -6,6 +6,7 @@
 //
 // Copyright 2005 Jeff Muizelaar <jeff at infidigm.net>
 // Copyright 2005-2009 Albert Astals Cid <aacid at kde.org>
+// Copyright 2009 Ryszard Trojnacki <rysiek at menel.com>
 //
 //========================================================================
 
@@ -74,7 +75,9 @@ static void exitErrorHandler(jpeg_common_struct *error) {
 
 void DCTStream::init()
 {
-  jpeg_create_decompress(&cinfo);
+  jpeg_std_error(&jerr);
+  jerr.error_exit = &exitErrorHandler;
+  cinfo.err = &jerr;
   src.pub.init_source = str_init_source;
   src.pub.fill_input_buffer = str_fill_input_buffer;
   src.pub.skip_input_data = str_skip_input_data;
@@ -86,11 +89,11 @@ void DCTStream::init()
   src.index = 0;
   src.abort = false;
   cinfo.src = (jpeg_source_mgr *)&src;
-  jpeg_std_error(&jerr);
-  jerr.error_exit = &exitErrorHandler;
-  cinfo.err = &jerr;
   current = NULL;
   limit = NULL;
+  
+  jpeg_create_decompress(&cinfo);
+  x = 0;
   row_buffer = NULL;
 }
 


More information about the poppler mailing list