From 654a0fdd31cb34e34bfdb03eb360c9ab3d5fedd9 Mon Sep 17 00:00:00 2001 From: Cristy Date: Thu, 14 Sep 2017 07:32:01 -0400 Subject: [PATCH] ... --- coders/ycbcr.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/coders/ycbcr.c b/coders/ycbcr.c index 585070c65..946e5e1b3 100644 --- a/coders/ycbcr.c +++ b/coders/ycbcr.c @@ -200,6 +200,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, count=0; length=0; scene=0; + status=MagickTrue; do { /* @@ -231,6 +232,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, { if (count != (ssize_t) length) { + status=MagickFalse; ThrowFileException(exception,CorruptImageError, "UnexpectedEndOfFile",image->filename); break; @@ -304,6 +306,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, { if (count != (ssize_t) length) { + status=MagickFalse; ThrowFileException(exception,CorruptImageError, "UnexpectedEndOfFile",image->filename); break; @@ -388,6 +391,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, { if (count != (ssize_t) length) { + status=MagickFalse; ThrowFileException(exception,CorruptImageError, "UnexpectedEndOfFile",image->filename); break; @@ -432,6 +436,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, { if (count != (ssize_t) length) { + status=MagickFalse; ThrowFileException(exception,CorruptImageError, "UnexpectedEndOfFile",image->filename); break; @@ -476,6 +481,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, { if (count != (ssize_t) length) { + status=MagickFalse; ThrowFileException(exception,CorruptImageError, "UnexpectedEndOfFile",image->filename); break; @@ -522,6 +528,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, { if (count != (ssize_t) length) { + status=MagickFalse; ThrowFileException(exception,CorruptImageError, "UnexpectedEndOfFile",image->filename); break; @@ -596,6 +603,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, GetQuantumPixels(quantum_info),&count); if (count != (ssize_t) length) { + status=MagickFalse; ThrowFileException(exception,CorruptImageError, "UnexpectedEndOfFile",image->filename); break; @@ -607,6 +615,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, { if (count != (ssize_t) length) { + status=MagickFalse; ThrowFileException(exception,CorruptImageError, "UnexpectedEndOfFile",image->filename); break; @@ -664,6 +673,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, GetQuantumPixels(quantum_info),&count); if (count != (ssize_t) length) { + status=MagickFalse; ThrowFileException(exception,CorruptImageError, "UnexpectedEndOfFile",image->filename); break; @@ -675,6 +685,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, { if (count != (ssize_t) length) { + status=MagickFalse; ThrowFileException(exception,CorruptImageError, "UnexpectedEndOfFile",image->filename); break; @@ -732,6 +743,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, GetQuantumPixels(quantum_info),&count); if (count != (ssize_t) length) { + status=MagickFalse; ThrowFileException(exception,CorruptImageError, "UnexpectedEndOfFile",image->filename); break; @@ -743,6 +755,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, { if (count != (ssize_t) length) { + status=MagickFalse; ThrowFileException(exception,CorruptImageError, "UnexpectedEndOfFile",image->filename); break; @@ -802,6 +815,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, GetQuantumPixels(quantum_info),&count); if (count != (ssize_t) length) { + status=MagickFalse; ThrowFileException(exception,CorruptImageError, "UnexpectedEndOfFile",image->filename); break; @@ -813,6 +827,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, { if (count != (ssize_t) length) { + status=MagickFalse; ThrowFileException(exception,CorruptImageError, "UnexpectedEndOfFile",image->filename); break; @@ -893,6 +908,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, quantum_info=DestroyQuantumInfo(quantum_info); canvas_image=DestroyImage(canvas_image); (void) CloseBlob(image); + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } -- 2.40.0