diff options
author | Pierre Joye <pierre.php@gmail.com> | 2022-01-31 11:46:15 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-31 11:46:15 +0700 |
commit | 3f08a018cb1a23657b9ef6bd1b8a9f9dc8f1b616 (patch) | |
tree | de20b974c12dee9692692f149677a1265c3670e9 | |
parent | ebf0fb19960f6e2c74268b4290a3897f0c8ce67b (diff) | |
download | libgd-3f08a018cb1a23657b9ef6bd1b8a9f9dc8f1b616.tar.gz |
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
-rw-r--r-- | src/gd_topal.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gd_topal.c b/src/gd_topal.c index b355e2d..0fff552 100644 --- a/src/gd_topal.c +++ b/src/gd_topal.c @@ -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); |