From: Cristy Date: Mon, 24 Dec 2018 15:47:11 +0000 (-0500) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12204 X-Git-Tag: 7.0.8-21~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5c4a77720af5fea59a5eee70f89896c6144103da;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12204 --- diff --git a/coders/cube.c b/coders/cube.c index 3e2a54e3e..4f95d6fae 100644 --- a/coders/cube.c +++ b/coders/cube.c @@ -204,13 +204,13 @@ static Image *ReadCUBEImage(const ImageInfo *image_info, char *q; + if (n >= (cube_level*cube_level*cube_level)) + break; q=buffer; cube[n].r=StringToDouble(q,&q); cube[n].g=StringToDouble(q,&q); cube[n].b=StringToDouble(q,&q); n++; - if (n >= (cube_level*cube_level*cube_level)) - break; } else if (('+' < *buffer) && (*buffer < ':'))