[Mesa-dev] [Bug 52996] Read out of bounds in swizzle_for_size() (MesaLib/src/mesa/program/ir_to_mesa.cpp)

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Jul 31 07:14:45 PDT 2012


https://bugs.freedesktop.org/show_bug.cgi?id=52996

--- Comment #1 from Brian Paul <brian.e.paul at gmail.com> 2012-07-31 14:14:45 UTC ---
The swizzle_for_size() function is (unchanged from Mesa 7.9 to today):

static int
swizzle_for_size(int size)
{
   int size_swizzles[4] = {
      MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X),
      MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y),
      MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_Z),
      MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W),
   };

   assert((size >= 1) && (size <= 4));
   return size_swizzles[size - 1];
}

My guess is that if something's going wrong, you're running a non-debug build
and the assertion is a no-op.  Can you rebuild Mesa for debugging and retest? 
If you can find the value of 'size' for this failure, that'd be helpful.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the mesa-dev mailing list