From 7b2c55c2280323956b7c70909775fc81cecf98bd Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Wed, 12 May 2021 08:56:58 +0200 Subject: [PATCH] Added missing status checks. --- coders/webp.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/coders/webp.c b/coders/webp.c index 2bad2b3457..c4c9e22039 100644 --- a/coders/webp.c +++ b/coders/webp.c @@ -353,10 +353,10 @@ 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) { @@ -364,7 +364,8 @@ static int ReadSingleWEBPImage(Image *image,const uint8_t *stream, 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); @@ -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) {