diff options
author | Antonino Daplas <adaplas@gmail.com> | 2007-06-05 13:15:26 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-06-05 13:15:26 -0700 |
commit | e7e8cc5ae63c39dbbbb5f14c5120bdf2d931fac9 (patch) | |
tree | 7588b1b02c13eb6827f527ab152aa3e6f077f9ee | |
parent | f2c138638687a7ffbf0d2a0e7addfec7bab9a765 (diff) | |
download | kernel_samsung_tuna-e7e8cc5ae63c39dbbbb5f14c5120bdf2d931fac9.zip kernel_samsung_tuna-e7e8cc5ae63c39dbbbb5f14c5120bdf2d931fac9.tar.gz kernel_samsung_tuna-e7e8cc5ae63c39dbbbb5f14c5120bdf2d931fac9.tar.bz2 |
[VIDEO] sunxvr500fb: Fix pseudo_palette array size
- the pseudo_palette is only 16 elements long.
- the pseudo_palette has only 16 elements. Do not write if regno (the array
index) is more than 15.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/video/sunxvr500.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/video/sunxvr500.c b/drivers/video/sunxvr500.c index 08880a6..71bf3f1 100644 --- a/drivers/video/sunxvr500.c +++ b/drivers/video/sunxvr500.c @@ -50,7 +50,7 @@ struct e3d_info { u32 fb8_0_off; u32 fb8_1_off; - u32 pseudo_palette[256]; + u32 pseudo_palette[16]; }; static int __devinit e3d_get_props(struct e3d_info *ep) @@ -126,7 +126,9 @@ static int e3d_setcolreg(unsigned regno, blue_8 = blue >> 8; value = (blue_8 << 24) | (green_8 << 16) | (red_8 << 8); - ((u32 *)info->pseudo_palette)[regno] = value; + + if (info->fix.visual == FB_VISUAL_TRUECOLOR && regno < 16) + ((u32 *)info->pseudo_palette)[regno] = value; red_10 = red >> 6; |