From: Anatolij Gustschin Date: Thu, 28 Apr 2011 22:02:07 +0200 Subject: [U-Boot] [PATCH v2] cfb_console: fix RLE bitmap drawing code In-Reply-To: <1304020391-30141-1-git-send-email-agust@denx.de> References: <1298131531-857-1-git-send-email-agust@denx.de> <1304020391-30141-1-git-send-email-agust@denx.de> Message-ID: <20110428220207.5ee17d0d@wker> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, 28 Apr 2011 21:53:11 +0200 Anatolij Gustschin wrote: > There seems to be tools producing incorrect 'end of bitmap data' > markers '0100' in a RLE bitmap. Drawing such bitmaps can result > in overwriting memory above the frame buffer. E.g. on MPC5121e > based boards this memory can contain U-Boot environment. > > We may not rely on the correct end of bitmap data marker 0001 > only, but also have to check whether we are going to draw a > valid frame buffer scan line. > > The patch provides a fix by maintaining a pixel counter > which is incremented by the amount of pixels we are going > to draw. If the counter exceeds frame buffer pixels limit > we stop the drawing with the error message. > > Reported-by: Michael Weiss > Signed-off-by: Anatolij Gustschin > Tested-by: Anatolij Gustschin > --- > drivers/video/cfb_console.c | 19 +++++++++++++++---- > 1 files changed, 15 insertions(+), 4 deletions(-) applied to u-boot-video/master.