]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/720
authorCristy <urban-warrior@imagemagick.org>
Sun, 3 Sep 2017 15:40:19 +0000 (11:40 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sun, 3 Sep 2017 15:40:19 +0000 (11:40 -0400)
coders/sixel.c

index 8e2e3d8906ef211872722a8116e5428cd179e1eb..d8cc31e04e0a8998deb1b1022191d8f9ed994eb8 100644 (file)
@@ -533,6 +533,8 @@ MagickBooleanType sixel_decode(unsigned char              /* in */  *p,
     *pheight = imsy;
     *ncolors = max_color_index + 1;
     *palette = (unsigned char *) AcquireQuantumMemory(*ncolors,4);
+    if (*palette == (unsigned char *) NULL)
+      return(MagickFalse);
     for (n = 0; n < (ssize_t) *ncolors; ++n) {
         (*palette)[n * 4 + 0] = sixel_palet[n] >> 16 & 0xff;
         (*palette)[n * 4 + 1] = sixel_palet[n] >> 8 & 0xff;