[poppler] poppler/poppler: DCTStream.cc,1.2.2.1,1.2.2.2

Kristian Høgsberg krh at freedesktop.org
Tue Jan 10 14:54:03 PST 2006


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

Modified Files:
      Tag: POPPLER_0_4_X
	DCTStream.cc 
Log Message:
2006-01-10  Kristian Høgsberg  <krh at redhat.com>

        * configure.ac: Bump realease to 0.4.4.

        * NEWS: Sum up changes.

        * poppler/DCTStream.cc: Backport patch for KDE #119569.



Index: DCTStream.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/DCTStream.cc,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -d -r1.2.2.1 -r1.2.2.2
--- DCTStream.cc	16 Aug 2005 05:22:37 -0000	1.2.2.1
+++ DCTStream.cc	10 Jan 2006 22:54:01 -0000	1.2.2.2
@@ -14,21 +14,25 @@
 
 static boolean str_fill_input_buffer(j_decompress_ptr cinfo)
 {
+  int c;
   struct str_src_mgr * src = (struct str_src_mgr *)cinfo->src;
   if (src->index == 0) {
-    src->buffer = 0xFF;
+    c = 0xFF;
     src->index++;
   }
   else if (src->index == 1) {
-    src->buffer = 0xD8;
+    c = 0xD8;
     src->index++;
   }
-  else {
-      src->buffer = src->str->getChar();
+  else c = src->str->getChar();
+  if (c != EOF)
+  {
+    src->buffer = c;
+    src->pub.next_input_byte = &src->buffer;
+    src->pub.bytes_in_buffer = 1;
+    return TRUE;
   }
-  src->pub.next_input_byte = &src->buffer;
-  src->pub.bytes_in_buffer = 1;
-  return TRUE;
+  else return FALSE;
 }
 
 static void str_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
@@ -83,18 +87,17 @@
   // the start marker...
   bool startFound = false;
   int c = 0, c2 = 0;
-  int n = 0;
   while (!startFound)
   {
     if (!c)
     {
       c = str->getChar();
-      if (c != 0xFF) c = 0;
       if (c == -1)
       {
         error(-1, "Could not find start of jpeg data");
         exit(1);
       }
+      if (c != 0xFF) c = 0;
     }
     else
     {
@@ -106,7 +109,6 @@
       }
       else startFound = true;
     }
-    n++;
   }
 
   jpeg_read_header(&cinfo, TRUE);
@@ -121,7 +123,9 @@
 
   if (x == 0) {
     if (cinfo.output_scanline < cinfo.output_height)
-      jpeg_read_scanlines(&cinfo, row_buffer, 1);
+    {
+      if (!jpeg_read_scanlines(&cinfo, row_buffer, 1)) return EOF;
+    }
     else return EOF;
   }
   c = row_buffer[0][x];



More information about the poppler mailing list