Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
fix php 72494, invalid color index not handled, can lead to crash
- Loading branch information
1 parent
bca12e4
commit 6ff72ae
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #include <stdio.h> | ||
| #include <stdlib.h> | ||
| #include "gd.h" | ||
|
|
||
| #include "gdtest.h" | ||
|
|
||
| int main() | ||
| { | ||
| gdImagePtr im, exp; | ||
| int error = 0; | ||
|
|
||
| im = gdImageCreate(50, 50); | ||
|
|
||
| if (!im) { | ||
| gdTestErrorMsg("gdImageCreate failed.\n"); | ||
| return 1; | ||
| } | ||
|
|
||
| gdImageCropThreshold(im, 1337, 0); | ||
| gdImageDestroy(im); | ||
| /* this bug tests a crash, it never reaches this point if the bug exists*/ | ||
| return 0; | ||
| } |