Skip to content

Commit 8f50b10

Browse files
committed
Fix GH-17772: imagepalettetotruecolor segfault on invalid truecolor pixel.
1 parent 4b5c29e commit 8f50b10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/gd/libgd/gd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3108,7 +3108,7 @@ int gdImagePaletteToTrueColor(gdImagePtr src)
31083108
const unsigned int sy = gdImageSY(src);
31093109
const unsigned int sx = gdImageSX(src);
31103110

3111-
src->tpixels = (int **) gdMalloc(sizeof(int *) * sy);
3111+
src->tpixels = (int **) gdCalloc(sizeof(int *), sy);
31123112
if (src->tpixels == NULL) {
31133113
return 0;
31143114
}

0 commit comments

Comments
 (0)