Skip to content

Commit

Permalink
ignore zero-length profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Sep 19, 2021
1 parent f76e974 commit 071274b
Showing 1 changed file with 27 additions and 24 deletions.
51 changes: 27 additions & 24 deletions coders/webp.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,35 +361,38 @@ static int ReadSingleWEBPImage(Image *image,const uint8_t *stream,
(void) WebPMuxGetFeatures(mux,&webp_flags);
if ((webp_flags & ICCP_FLAG) &&
(WebPMuxGetChunk(mux,"ICCP",&chunk) == WEBP_MUX_OK))
{
profile=BlobToStringInfo(chunk.bytes,chunk.size);
if (profile != (StringInfo *) NULL)
{
SetImageProfile(image,"ICC",profile,exception);
profile=DestroyStringInfo(profile);
}
}
if (chunk.size != 0)
{
profile=BlobToStringInfo(chunk.bytes,chunk.size);
if (profile != (StringInfo *) NULL)
{
SetImageProfile(image,"ICC",profile,exception);
profile=DestroyStringInfo(profile);
}
}
if ((webp_flags & EXIF_FLAG) &&
(WebPMuxGetChunk(mux,"EXIF",&chunk) == WEBP_MUX_OK))
{
profile=BlobToStringInfo(chunk.bytes,chunk.size);
if (profile != (StringInfo *) NULL)
{
SetImageProfile(image,"EXIF",profile,exception);
profile=DestroyStringInfo(profile);
}
}
if (chunk.size != 0)
{
profile=BlobToStringInfo(chunk.bytes,chunk.size);
if (profile != (StringInfo *) NULL)
{
SetImageProfile(image,"EXIF",profile,exception);
profile=DestroyStringInfo(profile);
}
}
if (((webp_flags & XMP_FLAG) &&
(WebPMuxGetChunk(mux,"XMP ",&chunk) == WEBP_MUX_OK)) ||
(WebPMuxGetChunk(mux,"XMP\0",&chunk) == WEBP_MUX_OK))
{
profile=BlobToStringInfo(chunk.bytes,chunk.size);
if (profile != (StringInfo *) NULL)
{
SetImageProfile(image,"XMP",profile,exception);
profile=DestroyStringInfo(profile);
}
}
if (chunk.size != 0)
{
profile=BlobToStringInfo(chunk.bytes,chunk.size);
if (profile != (StringInfo *) NULL)
{
SetImageProfile(image,"XMP",profile,exception);
profile=DestroyStringInfo(profile);
}
}
WebPMuxDelete(mux);
}
#endif
Expand Down

0 comments on commit 071274b

Please sign in to comment.