Skip to content

Commit

Permalink
Added missing status checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed May 12, 2021
1 parent e53f1fd commit 7b2c55c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions coders/webp.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,18 +353,19 @@ static int ReadSingleWEBPImage(Image *image,const uint8_t *stream,
content.size=length;
mux=WebPMuxCreate(&content,0);
(void) memset(&chunk,0,sizeof(chunk));
WebPMuxGetFeatures(mux,&webp_flags);
if (webp_flags & ICCP_FLAG)
(void) WebPMuxGetFeatures(mux,&webp_flags);
if ((webp_flags & ICCP_FLAG) &&
(WebPMuxGetChunk(mux,"ICCP",&chunk) == WEBP_MUX_OK))
{
WebPMuxGetChunk(mux,"ICCP",&chunk);
profile=BlobToStringInfo(chunk.bytes,chunk.size);
if (profile != (StringInfo *) NULL)
{
SetImageProfile(image,"ICC",profile);
profile=DestroyStringInfo(profile);
}
}
if (webp_flags & EXIF_FLAG)
if ((webp_flags & EXIF_FLAG) &&
(WebPMuxGetChunk(mux,"EXIF",&chunk) == WEBP_MUX_OK))
{
WebPMuxGetChunk(mux,"EXIF",&chunk);
profile=BlobToStringInfo(chunk.bytes,chunk.size);
Expand All @@ -374,9 +375,9 @@ static int ReadSingleWEBPImage(Image *image,const uint8_t *stream,
profile=DestroyStringInfo(profile);
}
}
if (webp_flags & XMP_FLAG)
if ((webp_flags & XMP_FLAG) &&
(WebPMuxGetChunk(mux,"XMP",&chunk) == WEBP_MUX_OK))
{
WebPMuxGetChunk(mux,"XMP",&chunk);
profile=BlobToStringInfo(chunk.bytes,chunk.size);
if (profile != (StringInfo *) NULL)
{
Expand Down

0 comments on commit 7b2c55c

Please sign in to comment.