Bug 103323

Summary: Possible unintended error message in file pixel.c line 286
Product: Mesa Reporter: Petru Mihancea <petrum>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact: mesa-dev
Severity: trivial    
Priority: low    
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Petru Mihancea 2017-10-18 07:00:27 UTC
While experimenting with a CodeSonar plugin we develop, we noticed a potential bug in file "src/mesa/main/pixel.c" line 286 (function _mesa_PixelMapusv).

if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) {
      /* test that mapsize is a power of two */
      if (!_mesa_is_pow_two(mapsize)) {
	 _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" ); //HERE
         return;
      }
}

Shouldn't the error message be "glPixelMapu>s<v(mapsize)" insead of "glPixelMapu>i<v(mapsize)"? In other words, shouldn't the 12th character be 's' instead of 'i' in the error message?

Thanks,
Petru Mihancea

Note: The problem has been detected automatically via static analysis.
Comment 1 Brian Paul 2017-10-18 15:53:04 UTC
You're correct.  I pushed a trivial patch to fix this.  
e17aa6cd9d42d4712f6df4f11a0cbac3735e55b4

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.