Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43291 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60032 invoked from network); 10 Mar 2009 11:26:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Mar 2009 11:26:49 -0000 Authentication-Results: pb1.pair.com header.from=mmcnicklebugs@googlemail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=mmcnicklebugs@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.219.169 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: mmcnicklebugs@googlemail.com X-Host-Fingerprint: 209.85.219.169 mail-ew0-f169.google.com Received: from [209.85.219.169] ([209.85.219.169:38980] helo=mail-ew0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2D/2D-30036-87E46B94 for ; Tue, 10 Mar 2009 06:26:49 -0500 Received: by ewy17 with SMTP id 17so1168890ewy.23 for ; Tue, 10 Mar 2009 04:26:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=xKXcDm9f+wTt2w2IlIbxX7hjcJ3xGjTFcZL682a0h9c=; b=It5A8LPPBbV0WDkPHCVd38No+YmgTJ8yq7VhoAIDAToXswhthZ62A+TuQZAdvwVDq9 q59PtSvxGf1ANxUs6sqk6tx/dJ5VG/Du+SfbQ/YK5Phl6iIneH48DRh008ixlw041vPM LvcWmmaYIQr39tajpsrXt05WqVmjhytZkBOYY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=sEZzAoWs9P0OPJIBf6VklMVMRpFNilVfPA/HUbP7t+J/Z6EuY/cYI9+Dmh1s0dVTlz NUZ6r7eIXUtcb58XjWzhY8TaZDrnZfIqjHapsJt7Xi+5QHSgZVGDODRm22CBTX/FK2nL q0HdleBx9O3YdaZ4doarpJLzNsiM5LFCYm5V4= Received: by 10.216.11.212 with SMTP id 62mr2603308wex.186.1236684405071; Tue, 10 Mar 2009 04:26:45 -0700 (PDT) Received: from ?192.168.1.5? (82-41-240-108.cable.ubr04.sgyl.blueyonder.co.uk [82.41.240.108]) by mx.google.com with ESMTPS id 24sm4519586eyx.54.2009.03.10.04.26.43 (version=SSLv3 cipher=RC4-MD5); Tue, 10 Mar 2009 04:26:44 -0700 (PDT) To: Pierre Joye Cc: internals@lists.php.net In-Reply-To: References: <1236683833.23999.18.camel@vimes> Content-Type: text/plain Date: Tue, 10 Mar 2009 11:27:38 +0000 Message-ID: <1236684458.23999.19.camel@vimes> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PATCH] Bug #45799 - imagepng() crashes on empty image From: mmcnicklebugs@googlemail.com (Martin McNickle) Patch is in the tracker now. -- Martin On Tue, 2009-03-10 at 12:19 +0100, Pierre Joye wrote: > hi, > > Please post a link to the patch in the bug tracker directly. > > Thanks for your work, > > Cheers, > > On Tue, Mar 10, 2009 at 12:17 PM, Martin McNickle > wrote: > > Hi all, > > > > I've created a simple patch for Bug #45799 [1] > > > > It employs a simple check to see if there are any colors associated with > > the image before outputting the PNG header. > > > > The patch is against CVS 5.3, shown below for convenience. I can create > > patches for the other branches if required. The tests pass. > > > > This is my first patch to PHP, so I've done anything wrong, give me some > > pointers as to how to fix it. > > > > Thanks, > > > > -- Martin McNickle > > > > [1] http://bugs.php.net/bug.php?id=45799 > > > > Index: ext/gd/libgd/gd_png.c > > =================================================================== > > RCS file: /repository/php-src/ext/gd/libgd/gd_png.c,v > > retrieving revision 1.17.4.2.2.5.2.3 > > diff -u -r1.17.4.2.2.5.2.3 gd_png.c > > --- ext/gd/libgd/gd_png.c 14 Jan 2009 10:16:15 -0000 1.17.4.2.2.5.2.3 > > +++ ext/gd/libgd/gd_png.c 10 Mar 2009 11:12:02 -0000 > > @@ -650,6 +650,12 @@ > > png_set_PLTE(png_ptr, info_ptr, palette, colors); > > } > > > > + if (colors <= 0 && !im->trueColor) { > > + php_gd_error("gd-png error: Invalid number of colors in > > palette./martin"); > > + png_destroy_write_struct (&png_ptr, &info_ptr); > > + return; > > + } > > + > > /* write out the PNG header info (everything up to first IDAT) */ > > png_write_info(png_ptr, info_ptr); > > > > > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > >