Permalink
Browse files

Avoid overflow when parsing PSD resource blocks

  • Loading branch information...
Cristy
Cristy committed May 6, 2016
1 parent dcdd212 commit 15dd190dfd7e7a3341bdc378f4f0daba9873322c
Showing with 1 addition and 1 deletion.
  1. +1 −1 coders/psd.c
View
@@ -643,7 +643,7 @@ static void ParseImageResourceBlocks(Image *image,
p=PushShortPixel(MSBEndian,p,&id);
p=PushShortPixel(MSBEndian,p,&short_sans);
p=PushLongPixel(MSBEndian,p,&count);
if (p+count > blocks+length)
if ((p+count) > (blocks+length-16))
return;
switch (id)
{

0 comments on commit 15dd190

Please sign in to comment.