[poppler] poppler/poppler: DCTStream.cc, 1.2, 1.3 DCTStream.h, 1.3, 1.4

Albert Astals Cid aacid at freedesktop.org
Tue Aug 2 05:15:42 EST 2005


Update of /cvs/poppler/poppler/poppler
In directory gabe:/tmp/cvs-serv12889/poppler

Modified Files:
	DCTStream.cc DCTStream.h 
Log Message:
Fix problem in the patch to fix #3299


Index: DCTStream.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/DCTStream.cc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- DCTStream.cc	25 Jul 2005 20:40:37 -0000	1.2
+++ DCTStream.cc	1 Aug 2005 19:15:40 -0000	1.3
@@ -15,7 +15,15 @@
 static boolean str_fill_input_buffer(j_decompress_ptr cinfo)
 {
   struct str_src_mgr * src = (struct str_src_mgr *)cinfo->src;
-  src->buffer = src->str->getChar();
+  if (src->index == 0) {
+    src->buffer = 0xFF;
+    src->index++;
+  }
+  else if (src->index == 1) {
+    src->buffer = 0xD8;
+    src->index++;
+  }
+  else src->buffer = src->str->getChar();
   src->pub.next_input_byte = &src->buffer;
   src->pub.bytes_in_buffer = 1;
   return TRUE;
@@ -50,6 +58,7 @@
   src.pub.bytes_in_buffer = 0;
   src.pub.next_input_byte = NULL;
   src.str = str;
+  src.index = 0;
   cinfo.src = (jpeg_source_mgr *)&src;
   cinfo.err = jpeg_std_error(&jerr);
   x = 0;
@@ -98,10 +107,6 @@
     n++;
   }
 
-  // ...and this skips the garbage
-  str->reset();
-  for (n = n - 2; n > 0; n--) str->getChar();
-  
   jpeg_read_header(&cinfo, TRUE);
   jpeg_start_decompress(&cinfo);
 

Index: DCTStream.h
===================================================================
RCS file: /cvs/poppler/poppler/poppler/DCTStream.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- DCTStream.h	3 Apr 2005 18:17:55 -0000	1.3
+++ DCTStream.h	1 Aug 2005 19:15:40 -0000	1.4
@@ -45,6 +45,7 @@
     struct jpeg_source_mgr pub;
     JOCTET buffer;
     Stream *str;
+    int index;
 };
 
 



More information about the poppler mailing list