|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21651 pdf_open_memory_image Segmentation Fault (11)
Submitted: 2003-01-15 02:51 UTC Modified: 2003-01-16 15:19 UTC
From: erweb at erweb dot it Assigned:
Status: Closed Package: PDF related
PHP Version: 4.3.0 OS: Linux RedHat
Private report: No CVE-ID: None
 [2003-01-15 02:51 UTC] erweb at erweb dot it
Well... as i work with PDF the following code causes 
a segmentation fault:

$tmp_image = ImageCreate($size[0]*$this->actual_img_dpi/$this->default_img_dpi, $size[1]*$this->actual_img_dpi/$this->default_img_dpi);
imagecopyresampled ($tmp_image, $im, 0, 0, 0, 0,$size[0]*$this->actual_img_dpi/$this->default_img_dpi, $size[1]*$this->actual_img_dpi/$this->default_img_dpi, $size[0], $size[1]);

$img = pdf_open_memory_image($pdf_doc, $tmp_image);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-15 03:49 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

 [2003-01-15 03:52 UTC]
And provide a FULL and SHORT example script which can be used to reproduce this too. And your configure line for PHP would be nice to know also.

 [2003-01-15 05:28 UTC] erweb at erweb dot it
Here it is:
'./configure' '--with-apxs' '--with-gd' '--with-freetype-dir=/usr/local/lib/' '--with-pgsql' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr/lib/' '--with-png-dir=/usr/lib/' '--with-zlib-dir=/usr/lib/' '--with-mysql' '--with-config-file-path=/etc/' '--with-pdflib=/usr/local/' '--enable-ftp' 

as i have done a few debug (homemade debug) sessions i noticed that the line where output stopped was 
$img = pdf_open_memory_image($pdf_doc, $tmp_image);

This is why i stopped the code there...
For the code snippet: i can't really provide it... this is part of a real big class!

 [2003-01-15 12:20 UTC]
Could you provide the image (url) that your are using?
 [2003-01-15 14:53 UTC]
And please,please, provide that GDB backtrace too.

 [2003-01-16 04:58 UTC] erweb at erweb dot it
yes the url is:

try it!
for the GDB trace i am workin on it... 
actually i'm not finding the core file.......
 [2003-01-16 15:19 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

 [2021-04-06 10:22 UTC]
Automatic comment on behalf of 
Log: Fixed bug #21651 (crash in pdf_open_memory_image() when inserting a
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 15:01:31 2024 UTC