Skip to content
Permalink
Browse files Browse the repository at this point in the history
Evaluate lazy pixel cache morphology to prevent buffer overflow (bug …
…report from Ibrahim M. El-Sayed)
  • Loading branch information
Cristy committed Aug 1, 2016
1 parent e077971 commit 76401e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
@@ -1,3 +1,7 @@
2016-07-01 7.0.2-7 Cristy <quetzlzacatenango@image...>
* Evaluate lazy pixel cache morphology to prevent buffer overflow (bug report
from Ibrahim M. El-Sayed).

2016-07-30 7.0.2-6 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 7.0.2-6, GIT revision 18651:df24175:20160729.

Expand Down
4 changes: 4 additions & 0 deletions MagickCore/enhance.c
Expand Up @@ -1049,6 +1049,8 @@ MagickExport MagickBooleanType ContrastStretchImage(Image *image,
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
if (SetImageGray(image,exception) != MagickFalse)
(void) SetImageColorspace(image,GRAYColorspace,exception);
if (SyncImagePixelCache(image,exception) == MagickFalse)
return(MagickFalse);
black=(double *) AcquireQuantumMemory(GetPixelChannels(image),sizeof(*black));
white=(double *) AcquireQuantumMemory(GetPixelChannels(image),sizeof(*white));
histogram=(double *) AcquireQuantumMemory(MaxMap+1UL,GetPixelChannels(image)*
Expand Down Expand Up @@ -1533,6 +1535,8 @@ MagickExport MagickBooleanType EqualizeImage(Image *image,
#endif
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
if (SyncImagePixelCache(image,exception) == MagickFalse)
return(MagickFalse);
equalize_map=(double *) AcquireQuantumMemory(MaxMap+1UL,
GetPixelChannels(image)*sizeof(*equalize_map));
histogram=(double *) AcquireQuantumMemory(MaxMap+1UL,GetPixelChannels(image)*
Expand Down

1 comment on commit 76401e1

@fgeek
Copy link

@fgeek fgeek commented on 76401e1 Aug 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.