[Bf-blender-cvs] [fd63220a35e] master: Cleanup: maybe uninitialized variable warning

Campbell Barton noreply at git.blender.org
Fri Jun 5 08:14:41 CEST 2020


Commit: fd63220a35e432136c41b35399630d7e10b79516
Author: Campbell Barton
Date:   Fri Jun 5 14:54:48 2020 +1000
Branches: master
https://developer.blender.org/rBfd63220a35e432136c41b35399630d7e10b79516

Cleanup: maybe uninitialized variable warning

===================================================================

M	source/blender/blenlib/intern/math_color.c

===================================================================

diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c
index cc29ebe4f20..c1f7b0c2907 100644
--- a/source/blender/blenlib/intern/math_color.c
+++ b/source/blender/blenlib/intern/math_color.c
@@ -91,6 +91,7 @@ void rgb_to_yuv(float r, float g, float b, float *ly, float *lu, float *lv, int
       break;
     case BLI_YUV_ITU_BT709:
     default:
+      BLI_assert(colorspace == BLI_YUV_ITU_BT709);
       y = 0.2126f * r + 0.7152f * g + 0.0722f * b;
       u = -0.09991f * r - 0.33609f * g + 0.436f * b;
       v = 0.615f * r - 0.55861f * g - 0.05639f * b;
@@ -113,6 +114,8 @@ void yuv_to_rgb(float y, float u, float v, float *lr, float *lg, float *lb, int
       b = y + 2.032f * u;
       break;
     case BLI_YUV_ITU_BT709:
+    default:
+      BLI_assert(colorspace == BLI_YUV_ITU_BT709);
       r = y + 1.28033f * v;
       g = y - 0.21482f * u - 0.38059f * v;
       b = y + 2.12798f * u;



More information about the Bf-blender-cvs mailing list