Bug 103323 - Possible unintended error message in file pixel.c line 286
Summary: Possible unintended error message in file pixel.c line 286
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: Other All
: low trivial
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-18 07:00 UTC by Petru Mihancea
Modified: 2017-10-18 15:53 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

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.