From 57b2c00cbf5d68cb30cf71b37ccc051d2b87c1a5 Mon Sep 17 00:00:00 2001 From: Cristy Date: Tue, 27 Mar 2018 19:44:25 -0400 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7158 --- coders/heic.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/coders/heic.c b/coders/heic.c index f8f337b93..510a05ed1 100644 --- a/coders/heic.c +++ b/coders/heic.c @@ -301,7 +301,8 @@ static MagickBooleanType ParseFullBox(Image *image, DataBuffer *db, } for (i = 0; i < MAX_ATOMS_IN_BOX && DBGetSize(db) > 0; i++) { - (void) ParseAtom(image, db, ctx, exception); + if (ParseAtom(image, db, ctx, exception) == MagickFalse) + return MagickFalse; } return MagickTrue; @@ -314,7 +315,8 @@ static MagickBooleanType ParseBox(Image *image, DataBuffer *db, i; for (i = 0; i < MAX_ATOMS_IN_BOX && DBGetSize(db) > 0; i++) { - (void) ParseAtom(image, db, ctx, exception); + if (ParseAtom(image, db, ctx, exception) == MagickFalse) + break; } return MagickTrue; @@ -493,7 +495,7 @@ static MagickBooleanType ParseInfeAtom(Image *image, DataBuffer *db, /* item indicies starts from 1 */ - if (id >= (ssize_t) ctx->idsCount) { + if (id > (ssize_t) ctx->idsCount) { ThrowAndReturn("item id is incorrect"); } -- 2.49.0