mirror of
https://github.com/ImageMagick/ImageMagick.git
synced 2026-05-31 11:18:42 +02:00
improve I/O exception checking
This commit is contained in:
+2
-1
@@ -353,6 +353,7 @@ static MagickBooleanType WriteARTImage(const ImageInfo *image_info,Image *image,
|
||||
quantum_info=DestroyQuantumInfo(quantum_info);
|
||||
if (y < (ssize_t) image->rows)
|
||||
ThrowWriterException(CorruptImageError,"UnableToWriteImageData");
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
|
||||
+13
-7
@@ -719,7 +719,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
}
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("G",image->filename);
|
||||
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
@@ -790,7 +791,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
}
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("R",image->filename);
|
||||
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
@@ -863,7 +865,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
|
||||
}
|
||||
if (image->alpha_trait != UndefinedPixelTrait)
|
||||
{
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("A",image->filename);
|
||||
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
@@ -1090,7 +1093,7 @@ static MagickBooleanType WriteBGRImage(const ImageInfo *image_info,Image *image,
|
||||
ExceptionInfo *exception)
|
||||
{
|
||||
MagickBooleanType
|
||||
status;
|
||||
status = MagickTrue;
|
||||
|
||||
MagickOffsetType
|
||||
scene;
|
||||
@@ -1360,7 +1363,8 @@ static MagickBooleanType WriteBGRImage(const ImageInfo *image_info,Image *image,
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
}
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("G",image->filename);
|
||||
status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode :
|
||||
AppendBinaryBlobMode,exception);
|
||||
@@ -1386,7 +1390,8 @@ static MagickBooleanType WriteBGRImage(const ImageInfo *image_info,Image *image,
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
}
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("R",image->filename);
|
||||
status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode :
|
||||
AppendBinaryBlobMode,exception);
|
||||
@@ -1415,7 +1420,8 @@ static MagickBooleanType WriteBGRImage(const ImageInfo *image_info,Image *image,
|
||||
(void) CloseBlob(image);
|
||||
if (quantum_type == BGRAQuantum)
|
||||
{
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("A",image->filename);
|
||||
status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode :
|
||||
AppendBinaryBlobMode,exception);
|
||||
|
||||
+2
-1
@@ -575,7 +575,8 @@ static MagickBooleanType WriteCALSImage(const ImageInfo *image_info,
|
||||
if (WriteBlob(image,length,group4) != (ssize_t) length)
|
||||
status=MagickFalse;
|
||||
group4=(unsigned char *) RelinquishMagickMemory(group4);
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
#endif
|
||||
|
||||
+2
-1
@@ -1229,6 +1229,7 @@ static MagickBooleanType WriteCINImage(const ImageInfo *image_info,Image *image,
|
||||
break;
|
||||
}
|
||||
quantum_info=DestroyQuantumInfo(quantum_info);
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
|
||||
+19
-11
@@ -692,8 +692,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
|
||||
if (DiscardBlobBytes(image,(MagickSizeType) image->offset) == MagickFalse)
|
||||
{
|
||||
status=MagickFalse;
|
||||
ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
|
||||
image->filename);
|
||||
ThrowFileException(exception,CorruptImageError,
|
||||
"UnexpectedEndOfFile",image->filename);
|
||||
break;
|
||||
}
|
||||
length=GetQuantumExtent(canvas_image,quantum_info,CyanQuantum);
|
||||
@@ -761,7 +761,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
}
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("M",image->filename);
|
||||
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
@@ -831,7 +832,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
}
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("Y",image->filename);
|
||||
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
@@ -902,7 +904,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
}
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("K",image->filename);
|
||||
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
@@ -975,7 +978,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
|
||||
}
|
||||
if (image->alpha_trait != UndefinedPixelTrait)
|
||||
{
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("A",image->filename);
|
||||
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
@@ -1195,7 +1199,7 @@ static MagickBooleanType WriteCMYKImage(const ImageInfo *image_info,
|
||||
Image *image,ExceptionInfo *exception)
|
||||
{
|
||||
MagickBooleanType
|
||||
status;
|
||||
status = MagickTrue;
|
||||
|
||||
MagickOffsetType
|
||||
scene;
|
||||
@@ -1486,7 +1490,8 @@ static MagickBooleanType WriteCMYKImage(const ImageInfo *image_info,
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
}
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("M",image->filename);
|
||||
status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode :
|
||||
AppendBinaryBlobMode,exception);
|
||||
@@ -1512,7 +1517,8 @@ static MagickBooleanType WriteCMYKImage(const ImageInfo *image_info,
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
}
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("Y",image->filename);
|
||||
status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode :
|
||||
AppendBinaryBlobMode,exception);
|
||||
@@ -1538,7 +1544,8 @@ static MagickBooleanType WriteCMYKImage(const ImageInfo *image_info,
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
}
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("K",image->filename);
|
||||
status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode :
|
||||
AppendBinaryBlobMode,exception);
|
||||
@@ -1566,7 +1573,8 @@ static MagickBooleanType WriteCMYKImage(const ImageInfo *image_info,
|
||||
}
|
||||
if (quantum_type == CMYKAQuantum)
|
||||
{
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("A",image->filename);
|
||||
status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode :
|
||||
AppendBinaryBlobMode,exception);
|
||||
|
||||
+2
-1
@@ -2071,6 +2071,7 @@ static MagickBooleanType WriteDPXImage(const ImageInfo *image_info,Image *image,
|
||||
quantum_info=DestroyQuantumInfo(quantum_info);
|
||||
if (y < (ssize_t) image->rows)
|
||||
ThrowWriterException(CorruptImageError,"UnableToWriteImageData");
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
|
||||
+2
-1
@@ -391,6 +391,7 @@ static MagickBooleanType WriteFARBFELDImage(const ImageInfo *image_info,
|
||||
quantum_info=DestroyQuantumInfo(quantum_info);
|
||||
if (y < (ssize_t) image->rows)
|
||||
ThrowWriterException(CorruptImageError,"UnableToWriteImageData");
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
|
||||
+2
-1
@@ -402,6 +402,7 @@ static MagickBooleanType WriteFAXImage(const ImageInfo *image_info,Image *image,
|
||||
break;
|
||||
} while (write_info->adjoin != MagickFalse);
|
||||
write_info=DestroyImageInfo(write_info);
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
|
||||
+2
-1
@@ -471,6 +471,7 @@ static MagickBooleanType WriteFL32Image(const ImageInfo *image_info,
|
||||
quantum_info=DestroyQuantumInfo(quantum_info);
|
||||
if (y < (ssize_t) image->rows)
|
||||
ThrowWriterException(CorruptImageError,"UnableToWriteImageData");
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
|
||||
+5
-3
@@ -588,7 +588,8 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
|
||||
(void) CloseBlob(image);
|
||||
if (image->alpha_trait != UndefinedPixelTrait)
|
||||
{
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("A",image->filename);
|
||||
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
@@ -806,7 +807,7 @@ static MagickBooleanType WriteGRAYImage(const ImageInfo *image_info,
|
||||
Image *image,ExceptionInfo *exception)
|
||||
{
|
||||
MagickBooleanType
|
||||
status;
|
||||
status = MagickTrue;
|
||||
|
||||
MagickOffsetType
|
||||
scene;
|
||||
@@ -1023,7 +1024,8 @@ static MagickBooleanType WriteGRAYImage(const ImageInfo *image_info,
|
||||
(void) CloseBlob(image);
|
||||
if (quantum_type == GrayAlphaQuantum)
|
||||
{
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("A",image->filename);
|
||||
status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode :
|
||||
AppendBinaryBlobMode,exception);
|
||||
|
||||
+2
-1
@@ -1372,7 +1372,8 @@ static MagickBooleanType WriteHEICImage(const ImageInfo *image_info,
|
||||
if (heif_image != (struct heif_image*) NULL)
|
||||
heif_image_release(heif_image);
|
||||
heif_context_free(heif_context);
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
#endif
|
||||
|
||||
+2
-1
@@ -1195,7 +1195,8 @@ static MagickBooleanType WriteJXLImage(const ImageInfo *image_info,Image *image,
|
||||
JxlEncoderDestroy(jxl_info);
|
||||
if (jxl_status != JXL_ENC_SUCCESS)
|
||||
ThrowWriterException(CoderError,"UnableToWriteImageData");
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
#endif
|
||||
|
||||
+2
-1
@@ -454,6 +454,7 @@ static MagickBooleanType WriteMAPImage(const ImageInfo *image_info,Image *image,
|
||||
(void) WriteBlob(image,(size_t) (q-pixels),pixels);
|
||||
}
|
||||
pixels=(unsigned char *) RelinquishMagickMemory(pixels);
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
|
||||
+2
-1
@@ -1745,6 +1745,7 @@ static MagickBooleanType WriteMATImage(const ImageInfo *image_info,Image *image,
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
} while (image_info->adjoin != MagickFalse);
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
|
||||
+2
-1
@@ -2849,6 +2849,7 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info,
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
} while (image_info->adjoin != MagickFalse);
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
|
||||
+2
-1
@@ -1567,6 +1567,7 @@ static MagickBooleanType WriteMPCImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
scene++;
|
||||
} while (image_info->adjoin != MagickFalse);
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
|
||||
+2
-1
@@ -397,6 +397,7 @@ static MagickBooleanType WritePGXImage(const ImageInfo *image_info,Image *image,
|
||||
quantum_info=DestroyQuantumInfo(quantum_info);
|
||||
if (y < (ssize_t) image->rows)
|
||||
ThrowWriterException(CorruptImageError,"UnableToWriteImageData");
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
|
||||
+2
-1
@@ -4023,6 +4023,7 @@ static MagickBooleanType WritePSDImage(const ImageInfo *image_info,
|
||||
status=MagickFalse;
|
||||
image->compression=compression;
|
||||
}
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
|
||||
+14
-8
@@ -107,7 +107,7 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
|
||||
*image;
|
||||
|
||||
MagickBooleanType
|
||||
status;
|
||||
status = MagickTrue;
|
||||
|
||||
MagickOffsetType
|
||||
scene;
|
||||
@@ -710,7 +710,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
}
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("G",image->filename);
|
||||
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
@@ -780,7 +781,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
}
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("B",image->filename);
|
||||
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
@@ -852,7 +854,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
|
||||
}
|
||||
if (image->alpha_trait != UndefinedPixelTrait)
|
||||
{
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("A",image->filename);
|
||||
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
@@ -1322,7 +1325,7 @@ static MagickBooleanType WriteRGBImage(const ImageInfo *image_info,
|
||||
Image *image,ExceptionInfo *exception)
|
||||
{
|
||||
MagickBooleanType
|
||||
status;
|
||||
status = MagickTrue;
|
||||
|
||||
MagickOffsetType
|
||||
scene;
|
||||
@@ -1597,7 +1600,8 @@ static MagickBooleanType WriteRGBImage(const ImageInfo *image_info,
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
}
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("G",image->filename);
|
||||
status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode :
|
||||
AppendBinaryBlobMode,exception);
|
||||
@@ -1623,7 +1627,8 @@ static MagickBooleanType WriteRGBImage(const ImageInfo *image_info,
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
}
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("B",image->filename);
|
||||
status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode :
|
||||
AppendBinaryBlobMode,exception);
|
||||
@@ -1651,7 +1656,8 @@ static MagickBooleanType WriteRGBImage(const ImageInfo *image_info,
|
||||
}
|
||||
if (quantum_type == RGBAQuantum)
|
||||
{
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("A",image->filename);
|
||||
status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode :
|
||||
AppendBinaryBlobMode,exception);
|
||||
|
||||
+2
-1
@@ -1417,6 +1417,7 @@ static MagickBooleanType WriteSIXELImage(const ImageInfo *image_info,
|
||||
sixel_palette,image->colors,-1,output);
|
||||
sixel_pixels=(sixel_pixel_t *) RelinquishMagickMemory(sixel_pixels);
|
||||
output=(sixel_output_t *) RelinquishMagickMemory(output);
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
|
||||
+2
-1
@@ -331,6 +331,7 @@ static MagickBooleanType WriteSTRIMGImage(const ImageInfo *image_info,
|
||||
quantum_info=DestroyQuantumInfo(quantum_info);
|
||||
if (y < (ssize_t) image->rows)
|
||||
ThrowWriterException(CorruptImageError,"UnableToWriteImageData");
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
|
||||
+2
-1
@@ -5277,6 +5277,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
token=DestroyString(token);
|
||||
if (primitive_info != (PrimitiveInfo *) NULL)
|
||||
primitive_info=(PrimitiveInfo *) RelinquishMagickMemory(primitive_info);
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
|
||||
+2
-1
@@ -2730,7 +2730,8 @@ static MagickBooleanType WriteGROUP4Image(const ImageInfo *image_info,
|
||||
huffman_image=DestroyImage(huffman_image);
|
||||
(void) fclose(file);
|
||||
(void) RelinquishUniqueFileResource(filename);
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
#endif
|
||||
|
||||
+2
-1
@@ -765,6 +765,7 @@ static MagickBooleanType WriteVIPSImage(const ImageInfo *image_info,
|
||||
metadata=GetImageProperty(image,"vips:metadata",exception);
|
||||
if (metadata != (const char*) NULL)
|
||||
WriteBlobString(image,metadata);
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
|
||||
+2
-1
@@ -1228,7 +1228,8 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info,
|
||||
(void) WriteBlob(image,writer.size,writer.mem);
|
||||
WebPMemoryWriterClear(&writer);
|
||||
#endif
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
#endif
|
||||
|
||||
+2
-1
@@ -1981,6 +1981,7 @@ static MagickBooleanType WriteWPGImage(const ImageInfo *image_info,Image *image,
|
||||
(void) WriteBlobLSBShort(image,offset & 0xffff);
|
||||
if (y < (ssize_t) image->rows)
|
||||
ThrowWriterException(CorruptImageError,"UnableToWriteImageData");
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
status=MagickFalse;
|
||||
return(status);
|
||||
}
|
||||
|
||||
+12
-5
@@ -701,7 +701,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
}
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("Cb",image->filename);
|
||||
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
@@ -771,7 +772,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
}
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("Cr",image->filename);
|
||||
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
@@ -844,6 +846,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
|
||||
if (image->alpha_trait != UndefinedPixelTrait)
|
||||
{
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("A",image->filename);
|
||||
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
@@ -1303,7 +1307,8 @@ static MagickBooleanType WriteYCBCRImage(const ImageInfo *image_info,
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
}
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("Cb",image->filename);
|
||||
status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode :
|
||||
AppendBinaryBlobMode,exception);
|
||||
@@ -1326,7 +1331,8 @@ static MagickBooleanType WriteYCBCRImage(const ImageInfo *image_info,
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
}
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("Cr",image->filename);
|
||||
status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode :
|
||||
AppendBinaryBlobMode,exception);
|
||||
@@ -1351,7 +1357,8 @@ static MagickBooleanType WriteYCBCRImage(const ImageInfo *image_info,
|
||||
}
|
||||
if (quantum_type == RGBAQuantum)
|
||||
{
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("A",image->filename);
|
||||
status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode :
|
||||
AppendBinaryBlobMode,exception);
|
||||
|
||||
+10
-5
@@ -351,7 +351,8 @@ static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception)
|
||||
}
|
||||
if (interlace == PartitionInterlace)
|
||||
{
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("U",image->filename);
|
||||
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
@@ -398,7 +399,8 @@ static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception)
|
||||
}
|
||||
if (interlace == PartitionInterlace)
|
||||
{
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("V",image->filename);
|
||||
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
@@ -703,7 +705,8 @@ static MagickBooleanType WriteYUVImage(const ImageInfo *image_info,Image *image,
|
||||
Sample image to an even width and height, if necessary.
|
||||
*/
|
||||
image->depth=(size_t) (quantum == 1 ? 8 : 16);
|
||||
width=image->columns+(image->columns & (unsigned int) (horizontal_factor-1));
|
||||
width=image->columns+(image->columns & (unsigned int) (horizontal_factor
|
||||
-1));
|
||||
height=image->rows+(image->rows & (unsigned int) (vertical_factor-1));
|
||||
yuv_image=ResizeImage(image,width,height,TriangleFilter,exception);
|
||||
if (yuv_image == (Image *) NULL)
|
||||
@@ -816,7 +819,8 @@ static MagickBooleanType WriteYUVImage(const ImageInfo *image_info,Image *image,
|
||||
*/
|
||||
if (interlace == PartitionInterlace)
|
||||
{
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("U",image->filename);
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
@@ -850,7 +854,8 @@ static MagickBooleanType WriteYUVImage(const ImageInfo *image_info,Image *image,
|
||||
*/
|
||||
if (interlace == PartitionInterlace)
|
||||
{
|
||||
(void) CloseBlob(image);
|
||||
if (CloseBlob(image) == MagickFalse)
|
||||
break;
|
||||
AppendImageFormat("V",image->filename);
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
|
||||
Reference in New Issue
Block a user