[Mesa-dev] [Bug 41768] New: Logic error in mesa/drivers/common/meta.c

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Oct 13 15:53:32 PDT 2011


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

           Summary: Logic error in mesa/drivers/common/meta.c
           Product: Mesa
           Version: git
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Mesa core
        AssignedTo: mesa-dev at lists.freedesktop.org
        ReportedBy: rsleevi at chromium.org


This was reported upstream to Chromium by way of
http://www.viva64.com/en/b/0113/ (Item N6)

http://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/drivers/common/meta.c#n2934

Lines 2943 - 2948
      if (ctx->DrawBuffer->Visual.redBits <= 8)
         return GL_UNSIGNED_BYTE;
      else if (ctx->DrawBuffer->Visual.redBits <= 8)
         return GL_UNSIGNED_SHORT;
      else
         return GL_FLOAT;

The logic appears incorrect, in that GL_UNSIGNED_SHORT will never be returned -
instead, it will return GL_FLOAT.

Cursory inspection of the Mesa sources indicates it supports 16bpp, so should
this be written instead as:
      if (ctx->DrawBuffer->Visual.redBits <= 8)
         return GL_UNSIGNED_BYTE;
      else if (ctx->DrawBuffer->Visual.redBits <= 16)
         return GL_UNSIGNED_SHORT;
      else
         return GL_FLOAT;

-- 
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