Skip to content

Commit

Permalink
Coders: proper check for out of bounds per https://bugs.chromium.org/…
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Mar 17, 2022
1 parent 78f03b6 commit 5468786
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions coders/dcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -4116,7 +4116,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
index=redmap[i];
if ((info.scale != (Quantum *) NULL) && (index >= 0) &&
(index <= (int) info.max_value))
(index <= (int) info.scale_size))
index=(int) info.scale[index];
image->colormap[i].red=(Quantum) index;
}
Expand All @@ -4125,7 +4125,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
index=greenmap[i];
if ((info.scale != (Quantum *) NULL) && (index >= 0) &&
(index <= (int) info.max_value))
(index <= (int) info.scale_size))
index=(int) info.scale[index];
image->colormap[i].green=(Quantum) index;
}
Expand All @@ -4134,7 +4134,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
index=bluemap[i];
if ((info.scale != (Quantum *) NULL) && (index >= 0) &&
(index <= (int) info.max_value))
(index <= (int) info.scale_size))
index=(int) info.scale[index];
image->colormap[i].blue=(Quantum) index;
}
Expand All @@ -4143,7 +4143,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
index=graymap[i];
if ((info.scale != (Quantum *) NULL) && (index >= 0) &&
(index <= (int) info.max_value))
(index <= (int) info.scale_size))
index=(int) info.scale[index];
image->colormap[i].red=(Quantum) index;
image->colormap[i].green=(Quantum) index;
Expand Down

0 comments on commit 5468786

Please sign in to comment.