Skip to content
Permalink
Browse files Browse the repository at this point in the history
...
  • Loading branch information
Cristy committed Jul 3, 2017
1 parent aeab33d commit 948356e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions coders/jpeg.c
Expand Up @@ -1030,6 +1030,11 @@ static Image *ReadJPEGImage(const ImageInfo *image_info,
image=DestroyImageList(image);
return((Image *) NULL);
}
/*
Verify that file size large enough to contain a JPEG datastream.
*/
if (GetBlobSize(image) < 107)
ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
/*
Initialize JPEG parameters.
*/
Expand Down Expand Up @@ -1504,6 +1509,7 @@ ModuleExport size_t RegisterJPEGImage(void)
#endif
entry->magick=(IsImageFormatHandler *) IsJPEG;
entry->adjoin=MagickFalse;
entry->seekable_stream=MagickTrue;
entry->description=ConstantString(description);
if (*version != '\0')
entry->version=ConstantString(version);
Expand All @@ -1520,6 +1526,7 @@ ModuleExport size_t RegisterJPEGImage(void)
#endif
entry->magick=(IsImageFormatHandler *) IsJPEG;
entry->adjoin=MagickFalse;
entry->seekable_stream=MagickTrue;
entry->description=ConstantString(description);
if (*version != '\0')
entry->version=ConstantString(version);
Expand All @@ -1535,6 +1542,7 @@ ModuleExport size_t RegisterJPEGImage(void)
entry->encoder=(EncodeImageHandler *) WriteJPEGImage;
#endif
entry->adjoin=MagickFalse;
entry->seekable_stream=MagickTrue;
entry->description=ConstantString(description);
if (*version != '\0')
entry->version=ConstantString(version);
Expand All @@ -1550,6 +1558,7 @@ ModuleExport size_t RegisterJPEGImage(void)
entry->encoder=(EncodeImageHandler *) WriteJPEGImage;
#endif
entry->adjoin=MagickFalse;
entry->seekable_stream=MagickTrue;
entry->description=ConstantString(description);
if (*version != '\0')
entry->version=ConstantString(version);
Expand All @@ -1565,6 +1574,7 @@ ModuleExport size_t RegisterJPEGImage(void)
entry->encoder=(EncodeImageHandler *) WriteJPEGImage;
#endif
entry->adjoin=MagickFalse;
entry->seekable_stream=MagickTrue;
entry->description=ConstantString(description);
if (*version != '\0')
entry->version=ConstantString(version);
Expand Down

0 comments on commit 948356e

Please sign in to comment.