From 7f3ae3a011e81a7991dee457c9103a58add658b9 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Tue, 9 Nov 2010 14:32:06 +0000 Subject: [PATCH] fixed crash in color-luv when OpenCV is built using GCC 4.1 --- modules/imgproc/src/color.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/imgproc/src/color.cpp b/modules/imgproc/src/color.cpp index d977dc87bf..87a3bf7a56 100644 --- a/modules/imgproc/src/color.cpp +++ b/modules/imgproc/src/color.cpp @@ -1479,12 +1479,13 @@ struct RGB2Luv_f const float* whitept, bool _srgb ) : srccn(_srccn), srgb(_srgb) { + volatile int i; initLabTabs(); if(!_coeffs) _coeffs = sRGB2XYZ_D65; if(!whitept) whitept = D65; - for( int i = 0; i < 3; i++ ) + for( i = 0; i < 3; i++ ) { coeffs[i*3] = _coeffs[i*3]; coeffs[i*3+1] = _coeffs[i*3+1];