Skip to content

Commit 15dd190

Browse files
author
Cristy
committed
Avoid overflow when parsing PSD resource blocks
1 parent dcdd212 commit 15dd190

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

coders/psd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ static void ParseImageResourceBlocks(Image *image,
643643
p=PushShortPixel(MSBEndian,p,&id);
644644
p=PushShortPixel(MSBEndian,p,&short_sans);
645645
p=PushLongPixel(MSBEndian,p,&count);
646-
if (p+count > blocks+length)
646+
if ((p+count) > (blocks+length-16))
647647
return;
648648
switch (id)
649649
{

0 commit comments

Comments
 (0)