clang-tidy: readability-else-after-return
[geeqie.git] / src / color-man.cc
index e9be69b..63dacd4 100644 (file)
@@ -724,16 +724,12 @@ static guchar *nclx_to_lcms_profile(const struct heif_color_profile_nclx *nclx,
                        cmsCloseProfile(profile);
                        return static_cast<guchar *>(data);
                        }
-               else
-                       {
-                       cmsCloseProfile(profile);
-                       return nullptr;
-                       }
-               }
-       else
-               {
+
+               cmsCloseProfile(profile);
                return nullptr;
                }
+
+       return nullptr;
 }
 
 guchar *heif_color_profile(FileData *fd, guint *profile_len)
@@ -788,20 +784,18 @@ guchar *heif_color_profile(FileData *fd, guint *profile_len)
 
                return static_cast<guchar *>(data);
                }
-       else
-               {
-               error_code = heif_image_handle_get_nclx_color_profile(handle, &nclxcp);
-               if (error_code.code)
-                       {
-                       log_printf("warning: heif reader error: %s\n", error_code.message);
-                       heif_context_free(ctx);
-                       heif_nclx_color_profile_free(nclxcp);
-                       return nullptr;
-                       }
 
-               profile = nclx_to_lcms_profile(nclxcp, profile_len);
+       error_code = heif_image_handle_get_nclx_color_profile(handle, &nclxcp);
+       if (error_code.code)
+               {
+               log_printf("warning: heif reader error: %s\n", error_code.message);
+               heif_context_free(ctx);
+               heif_nclx_color_profile_free(nclxcp);
+               return nullptr;
                }
 
+       profile = nclx_to_lcms_profile(nclxcp, profile_len);
+
        heif_context_free(ctx);
        heif_nclx_color_profile_free(nclxcp);