Bug 135417

Summary: kpdf crashes opening a pdf file
Product: [Unmaintained] kpdf Reporter: Giovanni Venturi <giovanni>
Component: generalAssignee: Albert Astals Cid <aacid>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: I cannot open this file with KPDF because it crashes
this is the correct pdf file that make to crash kpdf

Description Giovanni Venturi 2006-10-10 22:20:30 UTC
Version:           0.5.5 (using KDE 3.5.5, compiled sources)
Compiler:          gcc version 3.4.6
OS:                Linux (i686) release 2.6.17.13

I compiled KPDF from kdegraphics SVN trunk 3.5 on the 10th October and I get always crash opening the attached PDF file.

Using host libthread_db library "/lib/tls/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread -1232161088 (LWP 13947)]
[New Thread -1247450192 (LWP 13949)]
0xb69c8141 in gettimeofday () from /lib/tls/libc.so.6
#0  0xb69c8141 in gettimeofday () from /lib/tls/libc.so.6
#1  0xb70394bb in QEventLoop::activateTimers ()
   from /usr/lib/qt-copy/lib/libqt-mt.so.3
#2  0xb6ff418f in QEventLoop::processEvents ()
   from /usr/lib/qt-copy/lib/libqt-mt.so.3
#3  0xb705bbab in QEventLoop::enterLoop ()
   from /usr/lib/qt-copy/lib/libqt-mt.so.3
#4  0xb705bb04 in QEventLoop::exec () from /usr/lib/qt-copy/lib/libqt-mt.so.3
#5  0xb7045320 in QApplication::exec ()
   from /usr/lib/qt-copy/lib/libqt-mt.so.3
#6  0x0804efc6 in main ()
Comment 1 Giovanni Venturi 2006-10-10 22:22:01 UTC
Created attachment 18081 [details]
I cannot open this file with KPDF because it crashes
Comment 2 Albert Astals Cid 2006-10-10 22:39:59 UTC
Works here, please go to performace tab, uncheck the background generation option, make it crash and put the backtrace again, it should be more useful than the one you posted.
Comment 3 Giovanni Venturi 2006-10-10 23:08:57 UTC
Created attachment 18083 [details]
this is the correct pdf file that make to crash kpdf

I disabled as you sayed but with the correct PDF file and I get no debug output
and it chrashed the same.
Comment 4 Albert Astals Cid 2006-10-12 00:53:39 UTC
SVN commit 594669 by aacid:

Painting an image of 0x0 does not seem right and is making it crash
With this code we get roughly the same output than acroread, this basically means your pdf is broken
BUGS: 135417


 M  +2 -0      Splash.cc  
 M  +2 -0      SplashErrorCodes.h  


--- branches/KDE/3.5/kdegraphics/kpdf/xpdf/splash/Splash.cc #594668:594669
@@ -2346,6 +2346,8 @@
 	   (double)mat[3], (double)mat[4], (double)mat[5]);
   }
 
+  if (w == 0 && h == 0) return splashErrZeroImage;
+
   // check for singular matrix
   if (splashAbs(mat[0] * mat[3] - mat[1] * mat[2]) < 0.000001) {
     return splashErrSingularMatrix;
--- branches/KDE/3.5/kdegraphics/kpdf/xpdf/splash/SplashErrorCodes.h #594668:594669
@@ -29,4 +29,6 @@
 
 #define splashErrSingularMatrix  8	// matrix is singular
 
+#define splashErrZeroImage       9      // image of 0x0
+
 #endif