Fix #815, gd_topal, explicit null dereferenced (kind of false positiv… (#816)

* Fix #815, gd_topal, explicit null dereferenced (kind of false positive however it does hurt to add that check)

* Fix #815, != NULL
master
Pierre Joye 2022-01-31 11:46:15 +07:00 committed by GitHub
parent ebf0fb1996
commit 3f08a018cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -1703,6 +1703,9 @@ static int gdImageTrueColorToPaletteBody (gdImagePtr oim, int dither, int colors
select_colors (oim, nim, cquantize, colorsWanted);
zeroHistogram (cquantize->histogram);
if (dither) {
if (cquantize->error_limiter == NULL) {
goto outOfMemory;
}
pass2_fs_dither (oim, nim, cquantize);
} else {
pass2_no_dither (oim, nim, cquantize);