From 139915aaaf8ea4793222d907f9b45611b5d0223c Mon Sep 17 00:00:00 2001 From: Cristy Date: Mon, 5 Feb 2018 14:47:07 -0500 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5351 --- coders/xpm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coders/xpm.c b/coders/xpm.c index ca88c1751..d710287f7 100644 --- a/coders/xpm.c +++ b/coders/xpm.c @@ -379,6 +379,8 @@ static Image *ReadXPMImage(const ImageInfo *image_info,ExceptionInfo *exception) { p=next; next=NextXPMLine(p); + if (next == (char *) NULL) + break; (void) CopyXPMColor(key,p,MagickMin((size_t) width,MagickPathExtent-1)); status=AddValueToSplayTree(xpm_colors,ConstantString(key),(void *) j); /* -- 2.40.0