Skip to content

Commit c823253

Browse files
authored
Check ImagingNewDirty return value (#9688)
1 parent 1e36131 commit c823253

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/libImaging/Quant.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,6 +1837,11 @@ ImagingQuantize(Imaging im, int colors, int mode, int kmeans) {
18371837

18381838
if (result > 0) {
18391839
imOut = ImagingNewDirty(IMAGING_MODE_P, im->xsize, im->ysize);
1840+
if (!imOut) {
1841+
free(newData);
1842+
free(palette);
1843+
return NULL;
1844+
}
18401845
ImagingSectionEnter(&cookie);
18411846

18421847
for (i = y = 0; y < im->ysize; y++) {

0 commit comments

Comments
 (0)