From 8729fa1102db284152c1bf5ee9f461c1863d9b23 Mon Sep 17 00:00:00 2001 From: James Zern Date: Sat, 26 Aug 2017 14:20:51 -0700 Subject: [PATCH 1/2] cosmetics,cwebp: remove an else after a return this is redundant with an if block that returns BUG=webp:355 Change-Id: I4d2e520f89a8e144ab13aa3696f305365e584a0e --- examples/cwebp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/cwebp.c b/examples/cwebp.c index 27e51382..61350b9d 100644 --- a/examples/cwebp.c +++ b/examples/cwebp.c @@ -486,10 +486,10 @@ static int WriteWebPWithMetadata(FILE* const out, *metadata_written |= METADATA_XMP; } return ok; - } else { - // No metadata, just write the original image file. - return (fwrite(webp, webp_size, 1, out) == 1); } + + // No metadata, just write the original image file. + return (fwrite(webp, webp_size, 1, out) == 1); } //------------------------------------------------------------------------------ From 7945575c927265b16101757f04d0c7579d214099 Mon Sep 17 00:00:00 2001 From: James Zern Date: Sat, 26 Aug 2017 14:22:05 -0700 Subject: [PATCH 2/2] cosmetics,webpinfo: remove an else after a return this is redundant with an if block that returns BUG=webp:355 Change-Id: I66a64a0a4932c5f419f6171684b72088c43e7136 --- examples/webpinfo.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/webpinfo.c b/examples/webpinfo.c index 345e16d4..4b6d78c7 100644 --- a/examples/webpinfo.c +++ b/examples/webpinfo.c @@ -817,9 +817,8 @@ static WebPInfoStatus ProcessImageChunk(const ChunkData* const chunk_data, if (webp_info->seen_image_subchunk_) { LOG_ERROR("Consecutive VP8/VP8L sub-chunks in an ANMF chunk."); return WEBP_INFO_PARSE_ERROR; - } else { - webp_info->seen_image_subchunk_ = 1; } + webp_info->seen_image_subchunk_ = 1; } else { if (webp_info->chunk_counts_[CHUNK_VP8] || webp_info->chunk_counts_[CHUNK_VP8L]) { @@ -873,9 +872,9 @@ static WebPInfoStatus ProcessALPHChunk(const ChunkData* const chunk_data, if (webp_info->seen_alpha_subchunk_) { LOG_ERROR("Consecutive ALPH sub-chunks in an ANMF chunk."); return WEBP_INFO_PARSE_ERROR; - } else { - webp_info->seen_alpha_subchunk_ = 1; } + webp_info->seen_alpha_subchunk_ = 1; + if (webp_info->seen_image_subchunk_) { LOG_ERROR("ALPHA sub-chunk detected after VP8 sub-chunk " "in an ANMF chunk.");