Bug #68712 [Ver->Csd]: suspicious if-else statements
| From: | cmb@php.net | Date: | Sat, 23 Jul 2016 17:51:21 +0000 |
| Subject: | Bug #68712 [Ver->Csd]: suspicious if-else statements | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-202534@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68712&edit=1
ID: 68712
Updated by: cmb@php.net
Reported by: bugreports at internot dot info
Summary: suspicious if-else statements
-Status: Verified
+Status: Closed
Type: Bug
Package: GD related
Operating System: Linux Ubuntu 14.04
PHP Version: master-Git-2015-01-02 (Git)
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=php-src.git;a=commit;h=88838dd28200b53c4da7a558975b195fd41ba446
Log: Fix #68712: suspicious if-else statements
Previous Comments:
------------------------------------------------------------------------
[2016-07-23 17:32:48] cmb@php.net
> In each, each possiblity is the same. Is this intended?
Comparing with external libgd, it is indeed. Therefore the
if-statements are superfluous and should be removed to avoid
confusion.
------------------------------------------------------------------------
[2015-07-12 12:56:09] cmb@php.net
For easier reference:
<https://github.com/php/php-src/blob/php-5.6.11/ext/gd/libgd/gd_interpolation.c#L1539-L1545>
<https://github.com/php/php-src/blob/php-5.6.11/ext/gd/libgd/gd_interpolation.c#L1946-L1952>
It seems to me that the construction of the matrixes in
gdImageScaleBicubicFixed() and gdImageRotateBicubicFixed() need
review. Particularly, setting of index 9 seems to be erroneous:
<https://github.com/php/php-src/blob/php-5.6.11/ext/gd/libgd/gd_interpolation.c#L1507-L1513>
<https://github.com/php/php-src/blob/php-5.6.11/ext/gd/libgd/gd_interpolation.c#L2004-L2010>
------------------------------------------------------------------------
[2015-01-02 07:28:36] bugreports at internot dot info
Description:
------------
Hi,
in /ext/gd/libgd/gd_interpolation.c:
1539 if (m >= src_h - 2) {
1540 src_offset_x[13] = n;
1541 src_offset_y[13] = m;
1542 } else {
1543 src_offset_x[13] = n;
1544 src_offset_y[13] = m;
1545 }
and
1946 if (m < 1) {
1947 src_offset_x[1] = n;
1948 src_offset_y[1] = m;
1949 } else {
1950 src_offset_x[1] = n;
1951 src_offset_y[1] = m ;
1952 }
In each, each possiblity is the same. Is this intended?
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68712&edit=1