Skip to content
Permalink
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
pierrejoye committed Jun 27, 2016
1 parent bca12e4 commit 6ff72ae
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/gdimagecrop/php_bug_72494.c
@@ -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;
}

0 comments on commit 6ff72ae

Please sign in to comment.