[Rawstudio-dev] Syntax error leading to uninitialized variable in denoise plugin

Dale Olds dolds at novell.com
Thu Sep 24 18:58:46 CEST 2009


A few weeks ago, I had some trouble with segfaults using rawstudio from trunk. When I disabled the asm i386 optimizations, things got much better, but I eventually reverted to an older packaged build from OpenSUSE. Things are looking really good though, so I am looking forward to the next release.

While researching the segfault, I noticed something I believe would cause an intermittent use of some of the asm optimizations. The modules contains the following code:

FFTWindow::FFTWindow( int _w, int _h ) : 
analysis(FloatImagePlane(_w, _h)), 
synthesis(FloatImagePlane(_w,_h))
{
  analysisIsFlat = true;
  synthesisIsFlat = true;
  analysis.allocateImage();
  synthesis.allocateImage();
#if defined (__i386__) || defined (__x86_64__)
  SSEAvailable == !!(rs_detect_cpu_features() & RS_CPU_FLAG_SSE);
#endif
}

The problem is this line:
  SSEAvailable == !!(rs_detect_cpu_features() & RS_CPU_FLAG_SSE);

As I read it, this means that SSEAvailable is not actually assigned any value here, and is left uninitialized (at least by this code). Shouldn't this line be as follows?
  SSEAvailable = !!(rs_detect_cpu_features() & RS_CPU_FLAG_SSE);

--Dale





More information about the Rawstudio-dev mailing list