php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: erweb at erweb dot it
New email:
PHP Version: OS:

 

 [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);

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-15 03:49 UTC] derick@php.net
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
http://bugs.php.net/bugs-generating-backtrace.php

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] sniper@php.net
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' 

Then:
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!

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

 [2003-01-16 04:58 UTC] erweb at erweb dot it
yes the url is:
http://areaclienti.mine.nu/2820.png

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] iliaa@php.net
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 http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net 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] git@php.net
Automatic comment on behalf of 
Revision: https://github.com/php/pecl-text-pdflib/commit/c30ec820f7d5c12328615a0fcf1219b0fc231afd
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: Tue Apr 23 22:01:31 2024 UTC