SOURCES: kdegraphics-branch.diff fix CVE-2007-4352, CVE-2007-5392

arekm arekm at pld-linux.org
Fri Nov 9 15:01:57 CET 2007


Author: arekm                        Date: Fri Nov  9 14:01:57 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
fix CVE-2007-4352, CVE-2007-5392

---- Files affected:
SOURCES:
   kdegraphics-branch.diff (1.15 -> 1.16) 

---- Diffs:

================================================================
Index: SOURCES/kdegraphics-branch.diff
diff -u SOURCES/kdegraphics-branch.diff:1.15 SOURCES/kdegraphics-branch.diff:1.16
--- SOURCES/kdegraphics-branch.diff:1.15	Sun Aug 12 21:46:39 2007
+++ SOURCES/kdegraphics-branch.diff	Fri Nov  9 15:01:52 2007
@@ -1,1725 +1,1675 @@
-Index: kpdf/part.cpp
+Index: kpdf/core/generator_pdf/generator_pdf.cpp
 ===================================================================
---- kpdf/part.cpp	(.../tags/KDE/3.5.7/kdegraphics)	(wersja 699343)
-+++ kpdf/part.cpp	(.../branches/KDE/3.5/kdegraphics)	(wersja 699343)
-@@ -186,9 +186,13 @@
- 
- 	int index;
- 	// [left toolbox: Table of Contents] | []
--	m_tocFrame = new TOC( m_toolBox, m_document );
-+	// dummy wrapper with layout to enable horizontal scroll bars (bug: 147233)
-+	QWidget *tocWrapper = new QWidget(m_toolBox);
-+	QVBoxLayout *tocWrapperLayout = new QVBoxLayout(tocWrapper);
-+	m_tocFrame = new TOC( tocWrapper, m_document );
-+	tocWrapperLayout->add(m_tocFrame);
- 	connect(m_tocFrame, SIGNAL(hasTOC(bool)), this, SLOT(enableTOC(bool)));
--	index = m_toolBox->addItem( m_tocFrame, QIconSet(SmallIcon("text_left")), i18n("Contents") );
-+	index = m_toolBox->addItem( tocWrapper, QIconSet(SmallIcon("text_left")), i18n("Contents") );
- 	m_toolBox->setItemToolTip(index, i18n("Contents"));
- 	enableTOC( false );
+--- kpdf/core/generator_pdf/generator_pdf.cpp	(.../tags/KDE/3.5.8/kdegraphics)	(wersja 734657)
++++ kpdf/core/generator_pdf/generator_pdf.cpp	(.../branches/KDE/3.5/kdegraphics)	(wersja 734657)
+@@ -152,7 +152,7 @@
+         }
  
-@@ -619,6 +623,7 @@
-     }
-     if (m_wasPresentationOpen) slotShowPresentation();
-     emit enablePrintAction(true);
-+    emit setWindowCaption(url().filename());
+         // 2. reopen the document using the password
+-        GString * pwd2 = new GString( password.data() );
++        GString * pwd2 = new GString( QString::fromLocal8Bit(password.data()).latin1() );
+             delete pdfdoc;
+         pdfdoc = new PDFDoc( new GString( QFile::encodeName( filePath ) ), pwd2, pwd2 );
+             delete pwd2;
+Index: kpdf/xpdf/xpdf/Stream.cc
+===================================================================
+--- kpdf/xpdf/xpdf/Stream.cc	(.../tags/KDE/3.5.8/kdegraphics)	(wersja 734657)
++++ kpdf/xpdf/xpdf/Stream.cc	(.../branches/KDE/3.5/kdegraphics)	(wersja 734657)
+@@ -1245,23 +1245,30 @@
+   columns = columnsA;
+   if (columns < 1) {
+     columns = 1;
++  } else if (columns > INT_MAX - 2) {
++    columns = INT_MAX - 2;
    }
-   else
-   {
-Index: kpdf/core/document.cpp
-===================================================================
---- kpdf/core/document.cpp	(.../tags/KDE/3.5.7/kdegraphics)	(wersja 699343)
-+++ kpdf/core/document.cpp	(.../branches/KDE/3.5/kdegraphics)	(wersja 699343)
-@@ -1117,15 +1117,21 @@
-             break;
-         }
+-  if (columns + 4 <= 0) {
+-    columns = INT_MAX - 4;
+-  }
+   rows = rowsA;
+   endOfBlock = endOfBlockA;
+   black = blackA;
+-  refLine = (short *)gmallocn(columns + 3, sizeof(short));
+-  codingLine = (short *)gmallocn(columns + 2, sizeof(short));
++  // 0 <= codingLine[0] < codingLine[1] < ... < codingLine[n] = columns
++  // ---> max codingLine size = columns + 1
++  // refLine has one extra guard entry at the end
++  // ---> max refLine size = columns + 2
++  codingLine = (int *)gmallocn_checkoverflow(columns + 1, sizeof(int));
++  refLine = (int *)gmallocn_checkoverflow(columns + 2, sizeof(int));
+ 
+-  eof = gFalse;
++  if (codingLine != NULL && refLine != NULL) {
++    eof = gFalse;
++    codingLine[0] = columns;
++  } else {
++    eof = gTrue;
++  }
+   row = 0;
+   nextLine2D = encoding < 0;
+   inputBits = 0;
+-  codingLine[0] = 0;
+-  codingLine[1] = refLine[2] = columns;
+-  a0 = 1;
++  a0i = 0;
++  outputBits = 0;
  
--    // [MEM] 1.2 append memory allocation descriptor to the FIFO
--    int memoryBytes = 4 * req->width * req->height;
--    AllocatedPixmap * memoryPage = new AllocatedPixmap( req->id, req->pageNumber, memoryBytes );
--    d->allocatedPixmapsFifo.append( memoryPage );
--    d->allocatedPixmapsTotalMemory += memoryBytes;
-+    if ( d->observers.contains( req->id ) )
-+    {
-+        // [MEM] 1.2 append memory allocation descriptor to the FIFO
-+        int memoryBytes = 4 * req->width * req->height;
-+        AllocatedPixmap * memoryPage = new AllocatedPixmap( req->id, req->pageNumber, memoryBytes );
-+        d->allocatedPixmapsFifo.append( memoryPage );
-+        d->allocatedPixmapsTotalMemory += memoryBytes;
- 
--    // 2. notify an observer that its pixmap changed
--    if ( d->observers.contains( req->id ) )
-+        // 2. notify an observer that its pixmap changed
-         d->observers[ req->id ]->notifyPageChanged( req->pageNumber, DocumentObserver::Pixmap );
-+    }
-+#ifndef NDEBUG
-+    else
-+        kdWarning() << "Receiving a done request for the defunct observer " << req->id << endl;
-+#endif
+   buf = EOF;
+ }
+@@ -1276,13 +1283,18 @@
+   short code1;
  
-     // 3. delete request
-     delete req;
-Index: kpdf/core/generator_pdf/generator_pdf.cpp
-===================================================================
---- kpdf/core/generator_pdf/generator_pdf.cpp	(.../tags/KDE/3.5.7/kdegraphics)	(wersja 699343)
-+++ kpdf/core/generator_pdf/generator_pdf.cpp	(.../branches/KDE/3.5/kdegraphics)	(wersja 699343)
-@@ -316,7 +316,7 @@
-     // 1. Set OutputDev parameters and Generate contents
-     // note: thread safety is set on 'false' for the GUI (this) thread
-     kpdfOutputDev->setParams( request->width, request->height, genObjectRects, genObjectRects, false );
--    pdfdoc->displayPage( kpdfOutputDev, page->number() + 1, fakeDpiX, fakeDpiY, 0, false, true, genObjectRects );
-+    pdfdoc->displayPage( kpdfOutputDev, page->number() + 1, fakeDpiX, fakeDpiY, 0, false, true, false );
-     if ( genObjectRects )
-         pdfdoc->processLinks( kpdfOutputDev, page->number() + 1 );
- 
-@@ -498,7 +498,7 @@
-         docLock.lock();
-         for ( ; pIt != pEnd; ++pIt )
-         {
--            pdfdoc->displayPage(psOut, *pIt, 72, 72, 0, false, globalParams->getPSCrop(), gFalse);
-+            pdfdoc->displayPage(psOut, *pIt, 72, 72, 0, false, globalParams->getPSCrop(), gTrue);
-         }
-         docLock.unlock();
+   str->reset();
+-  eof = gFalse;
++
++  if (codingLine != NULL && refLine != NULL) {
++    eof = gFalse;
++    codingLine[0] = columns;
++  } else {
++    eof = gTrue;
++  }
+   row = 0;
+   nextLine2D = encoding < 0;
+   inputBits = 0;
+-  codingLine[0] = 0;
+-  codingLine[1] = columns;
+-  a0 = 1;
++  a0i = 0;
++  outputBits = 0;
+   buf = EOF;
  
-@@ -1197,7 +1197,7 @@
-     d->generator->kpdfOutputDev->setParams( width, height, 
-                                             genObjectRects, genObjectRects, TRUE /*thread safety*/ );
-     d->generator->pdfdoc->displayPage( d->generator->kpdfOutputDev, page->number() + 1,
--                                       fakeDpiX, fakeDpiY, 0, false, true, genObjectRects );
-+                                       fakeDpiX, fakeDpiY, 0, false, true, false );
-     if ( genObjectRects )
-         d->generator->pdfdoc->processLinks( d->generator->kpdfOutputDev, page->number() + 1 );
+   // skip any initial zero bits and end-of-line marker, and get the 2D
+@@ -1299,211 +1311,230 @@
+   }
+ }
  
-Index: kpdf/xpdf/xpdf/Stream.cc
-===================================================================
---- kpdf/xpdf/xpdf/Stream.cc	(.../tags/KDE/3.5.7/kdegraphics)	(wersja 699343)
-+++ kpdf/xpdf/xpdf/Stream.cc	(.../branches/KDE/3.5/kdegraphics)	(wersja 699343)
-@@ -411,9 +411,9 @@
- 
-   nVals = width * nComps;
-   if (width <= 0 || nComps <= 0 || nBits <= 0 ||
--      nComps >= INT_MAX / nBits ||
--      width >= INT_MAX / nComps / nBits ||
--      nVals * nBits + 7 < 0) {
-+      nComps > gfxColorMaxComps || nBits > 16 ||
-+      width >= INT_MAX / nComps ||
-+      nVals >= (INT_MAX - 7) / nBits) {
-     return;
++inline void CCITTFaxStream::addPixels(int a1, int blackPixels) {
++  if (a1 > codingLine[a0i]) {
++    if (a1 > columns) {
++      error(getPos(), "CCITTFax row is wrong length (%d)", a1);
++      err = gTrue;
++      a1 = columns;
++    }
++    if ((a0i & 1) ^ blackPixels) {
++      ++a0i;
++    }
++    codingLine[a0i] = a1;
++  }
++}
++
++inline void CCITTFaxStream::addPixelsNeg(int a1, int blackPixels) {
++  if (a1 > codingLine[a0i]) {
++    if (a1 > columns) {
++      error(getPos(), "CCITTFax row is wrong length (%d)", a1);
++      err = gTrue;
++      a1 = columns;
++    }
++    if ((a0i & 1) ^ blackPixels) {
++      ++a0i;
++    }
++    codingLine[a0i] = a1;
++  } else if (a1 < codingLine[a0i]) {
++    if (a1 < 0) {
++      error(getPos(), "Invalid CCITTFax code");
++      err = gTrue;
++      a1 = 0;
++    }
++    while (a0i > 0 && a1 <= codingLine[a0i - 1]) {
++      --a0i;
++    }
++    codingLine[a0i] = a1;
++  }
++}
++
+ int CCITTFaxStream::lookChar() {
+   short code1, code2, code3;
+-  int a0New;
+-  GBool err, gotEOL;
+-  int ret;
+-  int bits, i;
++  int b1i, blackPixels, i, bits;
++  GBool gotEOL;
+ 
+-  // if at eof just return EOF
+-  if (eof && codingLine[a0] >= columns) {
+-    return EOF;
++  if (buf != EOF) {
++    return buf;
    }
-   pixBytes = (nComps * nBits + 7) >> 3;
-Index: kpdf/shell/kpdf.desktop
-===================================================================
---- kpdf/shell/kpdf.desktop	(.../tags/KDE/3.5.7/kdegraphics)	(wersja 699343)
-+++ kpdf/shell/kpdf.desktop	(.../branches/KDE/3.5/kdegraphics)	(wersja 699343)
-@@ -1,6 +1,6 @@
- [Desktop Entry]
- Encoding=UTF-8
--MimeType=application/pdf
-+MimeType=application/pdf;
- Terminal=false
- Name=KPDF
- Name[ar]=برنامج KPDF
-Index: kpdf/ui/pagepainter.cpp
-===================================================================
---- kpdf/ui/pagepainter.cpp	(.../tags/KDE/3.5.7/kdegraphics)	(wersja 699343)
-+++ kpdf/ui/pagepainter.cpp	(.../branches/KDE/3.5/kdegraphics)	(wersja 699343)
-@@ -49,11 +49,24 @@
-     // if have no pixmap, draw blank page with gray cross and exit
-     if ( !pixmap )
-     {
--        if ( KpdfSettings::changeColors() &&
--             KpdfSettings::renderMode() == KpdfSettings::EnumRenderMode::Paper )
--            destPainter->fillRect( limits, KpdfSettings::paperColor() );
--        else
--            destPainter->fillRect( limits, Qt::white );
-+        QColor color = Qt::white;
-+        if ( KpdfSettings::changeColors() )
-+        {
-+            switch ( KpdfSettings::renderMode() )
-+            {
-+                case KpdfSettings::EnumRenderMode::Inverted:
-+                    color = Qt::black;
-+                    break;
-+                case KpdfSettings::EnumRenderMode::Paper:
-+                    color = KpdfSettings::paperColor();
-+                    break;
-+                case KpdfSettings::EnumRenderMode::Recolor:
-+                    color = KpdfSettings::recolorBackground();
-+                    break;
-+                default: ;
-+            }
-+        }
-+        destPainter->fillRect( limits, color );
- 
-         // draw a cross (to  that the pixmap as not yet been loaded)
-         // helps a lot on pages that take much to render
-Index: kpdf/ui/pageview.cpp
-===================================================================
---- kpdf/ui/pageview.cpp	(.../tags/KDE/3.5.7/kdegraphics)	(wersja 699343)
-+++ kpdf/ui/pageview.cpp	(.../branches/KDE/3.5/kdegraphics)	(wersja 699343)
-@@ -59,53 +59,6 @@
- // definition of searchID for this class
- #define PAGEVIEW_SEARCH_ID 2
- 
--class PageViewTip : public QToolTip
--{
--    public:
--        PageViewTip( PageView * view )
--            : QToolTip( view->viewport() ), m_view( view )
--        {
--        }
--
--        ~PageViewTip()
--        {
--            remove( m_view->viewport() );
--        }
--
--
--    protected:
--        void maybeTip( const QPoint &p );
--
--    private:
--        PageView * m_view;
--};
--
--void PageViewTip::maybeTip( const QPoint &_p )
--{
--    QPoint p( _p.x() + m_view->contentsX(), _p.y() + m_view->contentsY() );
--    PageViewItem * pageItem = m_view->pickItemOnPoint( p.x(), p.y() );
--    if ( pageItem )
--    {
--        double nX = (double)(p.x() - pageItem->geometry().left()) / (double)pageItem->width(),
--               nY = (double)(p.y() - pageItem->geometry().top()) / (double)pageItem->height();
--
--        // if over a ObjectRect (of type Link) change cursor to hand
--        const ObjectRect * object = pageItem->page()->hasObject( ObjectRect::Link, nX, nY );
--        if ( object )
--        {
--            // set tooltip over link's rect
--            KPDFLink *link = (KPDFLink *)object->pointer();
--            QString strtip = link->linkTip();
--            if ( !strtip.isEmpty() )
--            {
--                QRect linkRect = object->geometry( pageItem->width(), pageItem->height() );
--                linkRect.moveBy( - m_view->contentsX() + pageItem->geometry().left(), - m_view->contentsY() + pageItem->geometry().top() );
--                tip( linkRect, strtip );
--            }
--        }
+ 
+   // read the next row
+-  err = gFalse;
+-  if (codingLine[a0] >= columns) {
++  if (outputBits == 0) {
+ 
++    // if at eof just return EOF
++    if (eof) {
++      return EOF;
++    }
++
++    err = gFalse;
++
+     // 2-D encoding
+     if (nextLine2D) {
+-      // state:
+-      //   a0New = current position in coding line (0 <= a0New <= columns)
+-      //   codingLine[a0] = last change in coding line
+-      //                    (black-to-white if a0 is even,
+-      //                     white-to-black if a0 is odd)
+-      //   refLine[b1] = next change in reference line of opposite color
+-      //                 to a0
+-      // invariants:
+-      //   0 <= codingLine[a0] <= a0New
+-      //           <= refLine[b1] <= refLine[b1+1] <= columns
+-      //   0 <= a0 <= columns+1
+-      //   refLine[0] = 0
+-      //   refLine[n] = refLine[n+1] = columns
+-      //     -- for some 1 <= n <= columns+1
+-      // end condition:
+-      //   0 = codingLine[0] <= codingLine[1] < codingLine[2] < ...
+-      //     < codingLine[n-1] < codingLine[n] = columns
+-      //     -- where 1 <= n <= columns+1
+       for (i = 0; codingLine[i] < columns; ++i) {
+ 	refLine[i] = codingLine[i];
+       }
+-      refLine[i] = refLine[i + 1] = columns;
+-      b1 = 1;
+-      a0New = codingLine[a0 = 0] = 0;
+-      do {
++      refLine[i++] = columns;
++      refLine[i] = columns;
++      codingLine[0] = 0;
++      a0i = 0;
++      b1i = 0;
++      blackPixels = 0;
++      // invariant:
++      // refLine[b1i-1] <= codingLine[a0i] < refLine[b1i] < refLine[b1i+1]
++      //                                                             <= columns
++      // exception at left edge:
++      //   codingLine[a0i = 0] = refLine[b1i = 0] = 0 is possible
++      // exception at right edge:
++      //   refLine[b1i] = refLine[b1i+1] = columns is possible
++      while (codingLine[a0i] < columns) {
+ 	code1 = getTwoDimCode();
+ 	switch (code1) {
+ 	case twoDimPass:
+-	  if (refLine[b1] < columns) {
+-	    a0New = refLine[b1 + 1];
+-	    b1 += 2;
++	  addPixels(refLine[b1i + 1], blackPixels);
++	  if (refLine[b1i + 1] < columns) {
++	    b1i += 2;
+ 	  }
+ 	  break;
+ 	case twoDimHoriz:
+-	  if ((a0 & 1) == 0) {
+-	    code1 = code2 = 0;
++	  code1 = code2 = 0;
++	  if (blackPixels) {
+ 	    do {
+-	      code1 += code3 = getWhiteCode();
++	      code1 += code3 = getBlackCode();
+ 	    } while (code3 >= 64);
+ 	    do {
+-	      code2 += code3 = getBlackCode();
++	      code2 += code3 = getWhiteCode();
+ 	    } while (code3 >= 64);
+ 	  } else {
+-	    code1 = code2 = 0;
+ 	    do {
+-	      code1 += code3 = getBlackCode();
++	      code1 += code3 = getWhiteCode();
+ 	    } while (code3 >= 64);
+ 	    do {
+-	      code2 += code3 = getWhiteCode();
++	      code2 += code3 = getBlackCode();
+ 	    } while (code3 >= 64);
+ 	  }
+-	  if (code1 > 0 || code2 > 0) {
+-	    if (a0New + code1 <= columns) {
+-	      codingLine[a0 + 1] = a0New + code1;
+-	    } else {
+-	      codingLine[a0 + 1] = columns;
++	  addPixels(codingLine[a0i] + code1, blackPixels);
++	  if (codingLine[a0i] < columns) {
++	    addPixels(codingLine[a0i] + code2, blackPixels ^ 1);
++	  }
++	  while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
++	    b1i += 2;
++	  }
++	  break;
++	case twoDimVertR3:
++	  addPixels(refLine[b1i] + 3, blackPixels);
++	  blackPixels ^= 1;
++	  if (codingLine[a0i] < columns) {
++	    ++b1i;
++	    while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
++	      b1i += 2;
+ 	    }
+-	    ++a0;
+-	    if (codingLine[a0] + code2 <= columns) {
+-	      codingLine[a0 + 1] = codingLine[a0] + code2;
+-	    } else {
+-	      codingLine[a0 + 1] = columns;
+-	    }
+-	    ++a0;
+-	    a0New = codingLine[a0];
+-	    while (refLine[b1] <= a0New && refLine[b1] < columns) {
+-	      b1 += 2;
+-	    }
+ 	  }
+ 	  break;
+-	case twoDimVert0:
+-	  if (refLine[b1] < columns) {
+-	    a0New = codingLine[++a0] = refLine[b1];
+-	    ++b1;
+-	    while (refLine[b1] <= a0New && refLine[b1] < columns) {
+-	      b1 += 2;
++	case twoDimVertR2:
++	  addPixels(refLine[b1i] + 2, blackPixels);
++	  blackPixels ^= 1;
++	  if (codingLine[a0i] < columns) {
++	    ++b1i;
++	    while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
++	      b1i += 2;
+ 	    }
+-	  } else {
+-	    a0New = codingLine[++a0] = columns;
+ 	  }
+ 	  break;
+ 	case twoDimVertR1:
+-	  if (refLine[b1] + 1 < columns) {
+-	    a0New = codingLine[++a0] = refLine[b1] + 1;
+-	    ++b1;
+-	    while (refLine[b1] <= a0New && refLine[b1] < columns) {
+-	      b1 += 2;
++	  addPixels(refLine[b1i] + 1, blackPixels);
++	  blackPixels ^= 1;
++	  if (codingLine[a0i] < columns) {
++	    ++b1i;
++	    while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
++	      b1i += 2;
+ 	    }
+-	  } else {
+-	    a0New = codingLine[++a0] = columns;
+ 	  }
+ 	  break;
+-	case twoDimVertL1:
+-	  if (refLine[b1] - 1 > a0New || (a0 == 0 && refLine[b1] == 1)) {
+-	    a0New = codingLine[++a0] = refLine[b1] - 1;
+-	    --b1;
+-	    while (refLine[b1] <= a0New && refLine[b1] < columns) {
+-	      b1 += 2;
++	case twoDimVert0:
++	  addPixels(refLine[b1i], blackPixels);
++	  blackPixels ^= 1;
++	  if (codingLine[a0i] < columns) {
++	    ++b1i;
++	    while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
++	      b1i += 2;
+ 	    }
+ 	  }
+ 	  break;
+-	case twoDimVertR2:
+-	  if (refLine[b1] + 2 < columns) {
+-	    a0New = codingLine[++a0] = refLine[b1] + 2;
+-	    ++b1;
+-	    while (refLine[b1] <= a0New && refLine[b1] < columns) {
+-	      b1 += 2;
++	case twoDimVertL3:
++	  addPixelsNeg(refLine[b1i] - 3, blackPixels);
++	  blackPixels ^= 1;
++	  if (codingLine[a0i] < columns) {
++	    if (b1i > 0) {
++	      --b1i;
++	    } else {
++	      ++b1i;
+ 	    }
+-	  } else {
+-	    a0New = codingLine[++a0] = columns;
++	    while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
++	      b1i += 2;
++	    }
+ 	  }
+ 	  break;
+ 	case twoDimVertL2:
+-	  if (refLine[b1] - 2 > a0New || (a0 == 0 && refLine[b1] == 2)) {
+-	    a0New = codingLine[++a0] = refLine[b1] - 2;
+-	    --b1;
+-	    while (refLine[b1] <= a0New && refLine[b1] < columns) {
+-	      b1 += 2;
++	  addPixelsNeg(refLine[b1i] - 2, blackPixels);
++	  blackPixels ^= 1;
++	  if (codingLine[a0i] < columns) {
++	    if (b1i > 0) {
++	      --b1i;
++	    } else {
++	      ++b1i;
+ 	    }
+-	  }
+-	  break;
+-	case twoDimVertR3:
+-	  if (refLine[b1] + 3 < columns) {
+-	    a0New = codingLine[++a0] = refLine[b1] + 3;
+-	    ++b1;
+-	    while (refLine[b1] <= a0New && refLine[b1] < columns) {
+-	      b1 += 2;
++	    while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
++	      b1i += 2;
+ 	    }
+-	  } else {
+-	    a0New = codingLine[++a0] = columns;
+ 	  }
+ 	  break;
+-	case twoDimVertL3:
+-	  if (refLine[b1] - 3 > a0New || (a0 == 0 && refLine[b1] == 3)) {
+-	    a0New = codingLine[++a0] = refLine[b1] - 3;
+-	    --b1;
+-	    while (refLine[b1] <= a0New && refLine[b1] < columns) {
+-	      b1 += 2;
++	case twoDimVertL1:
++	  addPixelsNeg(refLine[b1i] - 1, blackPixels);
++	  blackPixels ^= 1;
++	  if (codingLine[a0i] < columns) {
++	    if (b1i > 0) {
++	      --b1i;
++	    } else {
++	      ++b1i;
+ 	    }
++	    while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
++	      b1i += 2;
++	    }
+ 	  }
+ 	  break;
+ 	case EOF:
++	  addPixels(columns, 0);
+ 	  eof = gTrue;
+-	  codingLine[a0 = 0] = columns;
+-	  return EOF;
++	  break;
+ 	default:
+ 	  error(getPos(), "Bad 2D code %04x in CCITTFax stream", code1);
++	  addPixels(columns, 0);
+ 	  err = gTrue;
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/kdegraphics-branch.diff?r1=1.15&r2=1.16&f=u



More information about the pld-cvs-commit mailing list