Skip to content
Permalink
Browse files
Avoid overflow when parsing PSD resource blocks
  • Loading branch information
Cristy committed May 6, 2016
1 parent dcdd212 commit 15dd190dfd7e7a3341bdc378f4f0daba9873322c
Showing 1 changed file with 1 addition and 1 deletion.
@@ -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.