Skip to content

Commit 5204a16

Browse files
committed
Corrected loop initialization to prevent out of bounds read (https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-wrhr-rf8j-r842)
1 parent 621b8d8 commit 5204a16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

coders/pcd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ static MagickBooleanType DecodeImage(Image *image,unsigned char *luma,
314314
Decode luminance or chrominance deltas.
315315
*/
316316
r=pcd_table[plane];
317-
for (i=0; ((i < pcd_length[plane]) && ((sum & r->mask) != r->sequence)); i++)
317+
for (i=1; ((i < pcd_length[plane]) && ((sum & r->mask) != r->sequence)); i++)
318318
r++;
319319
if ((row > image->rows) || (r == (PCDTable *) NULL))
320320
{

0 commit comments

Comments
 (0)