Bug 1858 - array subscript out of range
Summary: array subscript out of range
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/Gamma (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Xorg Project Team
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-15 03:40 UTC by dcb314
Modified: 2009-08-24 12:22 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description dcb314 2004-11-15 03:40:52 UTC
Hello there,

I just tried to compile X11R6.8.1 with the most excellent Intel C
8.1 compiler, on a Linux Fedora Core 3 box. The compiler said

gamma_state.c(1593): warning #175: subscript out of range

The source code is in file

./extras/Mesa/src/mesa/drivers/dri/gamma/gamma_state.c

The source code is

    WRITE(gmesa->buf, TxBaseAddr12, curTex->TextureBaseAddr[12]);

but

[dcb@localhost xc]$ find . -name \*.h -print | xargs grep TextureBaseAddr
./extras/Mesa/src/mesa/drivers/dri/gamma/gamma_context.h:   uint32_t
TextureBaseAddr[GAMMA_TEX_MAXLEVELS];

and

[dcb@localhost xc]$ find . -name \*.h -print | xargs grep GAMMA_TEX_MAXLEVELS
./extras/Mesa/src/mesa/drivers/dri/gamma/gamma_context.h:#define
GAMMA_TEX_MAXLEVELS 12

so curTex->TextureBaseAddr[12] doesn't exist. Suggest code re-work.
Comment 1 Adam Jackson 2005-03-31 10:22:23 UTC
GlintTexBaseAddr[0-12]Tag are defined so i think we just need to bump
GAMMA_TEX_MAXLEVELS to 13.  sound right to everyone else?
Comment 2 Brian Paul 2005-07-26 10:11:45 UTC
The max texture size is 2k by 2k.  Therefore the number of mipmap levels is 12.
Remove the bogus WRITE line.
Comment 3 Adam Jackson 2009-08-24 12:22:52 UTC
Mass version move, cvs -> git


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.