php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68714 copy 'n paste error
Submitted: 2015-01-02 07:47 UTC Modified: 2015-07-12 13:35 UTC
From: bugreports at internot dot info Assigned: cmb (profile)
Status: Closed Package: GD related
PHP Version: master-Git-2015-01-02 (Git) OS: Linux Ubuntu 14.04
Private report: No CVE-ID: None
 [2015-01-02 07:47 UTC] bugreports at internot dot info
Description:
------------
Hi,

In /ext/gd/libgd/gd_arc.c:



 95                if(old_y2!=my2){
 96                        for(i=mx1;i<=mx2;i++){
 97                                gdImageSetPixel(im,i,my1,c);
 98                        }
 99                }
   
original: old_y2 != my2 looks like the original copy.
100                if(old_y2!=my2){
101                        for(i=mx1;i<=mx2;i++){
102                                gdImageSetPixel(im,i,my2,c);
103                        }
104                }


I'm guessing the first one should be "if(old_y1!=my1)" ?


Thanks,


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-08 08:17 UTC] laruence@php.net
-Assigned To: +Assigned To: pajoye
 [2015-07-12 13:35 UTC] cmb@php.net
-Status: Assigned +Status: Analyzed -Assigned To: pajoye +Assigned To: cmb
 [2015-07-12 13:35 UTC] cmb@php.net
> I'm guessing the first one should be "if(old_y1!=my1)" ?

Indeed, that would be cleaner. However, it doesn't change the
behavior of the algorithm[1]. Actually, only one of old_y1 and
old_y2 is needed, because old_y1!=my1 is equivalent to
old_y2!=my2. This simplification is already done in the external
libgd[2], however, one could go a step further and merge both for
loops.

[1] <https://github.com/php/php-src/blob/php-5.6.11/ext/gd/libgd/gd_arc.c#L81-L107>
[2] <https://github.com/libgd/libgd/blob/gd-2.1.1/src/gd.c#L1897-L1923>
 [2015-07-12 14:44 UTC] cmb@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ba7c3a1bb40c4c087436a230dd7372ff9b6413d8
Log: Fix #68714: copy 'n paste error
 [2015-07-12 14:44 UTC] cmb@php.net
-Status: Analyzed +Status: Closed
 [2015-07-14 08:14 UTC] cmb@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3aad9bd3eea446014bf12901bcc374e0ff8de961
Log: Fix #68714: copy 'n paste error
 [2015-07-21 14:21 UTC] ab@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ba7c3a1bb40c4c087436a230dd7372ff9b6413d8
Log: Fix #68714: copy 'n paste error
 [2015-07-21 14:21 UTC] ab@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3aad9bd3eea446014bf12901bcc374e0ff8de961
Log: Fix #68714: copy 'n paste error
 [2016-07-20 11:37 UTC] davey@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3aad9bd3eea446014bf12901bcc374e0ff8de961
Log: Fix #68714: copy 'n paste error
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 09:01:32 2024 UTC