Skip to content
Permalink
Browse files Browse the repository at this point in the history
pict: Fixed a bug with ICC profile extraction
Could cause a NULL pointer dereference.

Found by F. Çelik.
  • Loading branch information
jsummers committed Mar 12, 2021
1 parent 7a0fd74 commit 287f5ac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/pict.c
Expand Up @@ -660,6 +660,11 @@ static void do_iccprofile_item(deark *c, lctx *d, i64 pos, i64 len)
if(selector==0 || selector==1) {
// Beginning and Continuation segments normally have profile data.
// End segments (selector==2) are not allowed to include data.

if(!d->iccprofile_file) {
de_warn(c, "Bad ICC profile segment");
return;
}
dbuf_copy(c->infile, pos+4, data_len, d->iccprofile_file);
}
}
Expand Down

1 comment on commit 287f5ac

@abergmann
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CVE-2021-28855 was assigned to this commit.

Please sign in to comment.