Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7e8cc5a authored by Antonino Daplas's avatar Antonino Daplas Committed by David S. Miller
Browse files

[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: default avatarAntonino Daplas <adaplas@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f2c13863
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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,6 +126,8 @@ static int e3d_setcolreg(unsigned regno,
	blue_8 = blue >> 8;

	value = (blue_8 << 24) | (green_8 << 16) | (red_8 << 8);

	if (info->fix.visual == FB_VISUAL_TRUECOLOR && regno < 16)
		((u32 *)info->pseudo_palette)[regno] = value;