php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78416 Invalid opcode from imagesetpixel
Submitted: 2019-08-15 02:31 UTC Modified: 2019-08-25 04:22 UTC
From: 115233618 at qq dot com Assigned:
Status: No Feedback Package: GD related
PHP Version: 7.2.21 OS: CentOS 7.3 X64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: 115233618 at qq dot com
New email:
PHP Version: OS:

 

 [2019-08-15 02:31 UTC] 115233618 at qq dot com
Description:
------------
PHP Fatal error:  Invalid opcode 23/16/8. in /wwwroot/web/protected/controller/VerifyController.php on line 41

VerifyController.php文件第41行代码:
imagesetpixel($this->im,$this->width,$this->height,$this->point_color);//生成干扰像素

Test script:
---------------
    function set_point(){
        if(empty($this->point_num)){
            $this->point_num=100;
        }
        for($i=0;$i<$this->point_num;$i++){
            $this->point_color=imagecolorallocate($this->im,mt_rand(0,255),mt_rand(0,255),mt_rand(0,255));//生成干扰像素颜色
            imagesetpixel($this->im,$this->width,$this->height,$this->point_color);//生成干扰像素
        }
    }

Expected result:
----------------
在png画布上生成干扰线,代码在php 7.2.18以下可以正常运行

Actual result:
--------------
环境升级到php7.2.21后该段代码运行报错:
PHP Fatal error:  Invalid opcode 23/16/8.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-08-15 08:04 UTC] sjon@php.net
-Summary: 在使用GD库生成验证码图片的干扰线时报错 +Summary: Invalid opcode from imagesetpixel -Package: Unknown/Other Function +Package: GD related
 [2019-08-15 08:13 UTC] nikic@php.net
-Status: Open +Status: Feedback
 [2019-08-15 08:13 UTC] nikic@php.net
Can you please provide a more complete reproduce script?

Opcode 23 is ASSIGN_ADD, which is not produced by your code at all (it will likely involve "+=").
 [2019-08-25 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 15:01:33 2024 UTC