j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Author: blueswirl Date: Wed Sep 29 20:34:41 2010 New Revision: 871 URL: http://tracker.coreboot.org/trac/openbios/changeset/871
Log: video: improve boundary checking
Add checks to fill_rect() and video_scroll().
Signed-off-by: Blue Swirl blauwirbel@gmail.com
Modified: trunk/openbios-devel/packages/video.c
Modified: trunk/openbios-devel/packages/video.c ============================================================================== --- trunk/openbios-devel/packages/video.c Wed Sep 29 19:06:31 2010 (r870) +++ trunk/openbios-devel/packages/video.c Wed Sep 29 20:34:41 2010 (r871) @@ -142,7 +142,8 @@ char *pp; unsigned long col = get_color(col_ind);
- if( !video.has_video || x < 0 || y < 0 || x+w > video.fb.w || y+h > video.fb.h ) + if (!video.has_video || x < 0 || y < 0 || w <= 0 || h <= 0 || + x + w > video.fb.w || y + h > video.fb.h) return;
pp = (char*)video.fb.mphys + video.fb.rb * y; @@ -203,6 +204,9 @@ { int i, offs, size, *dest, *src;
+ if (height <= 0 || height >= video.fb.h) { + return; + } offs = video.fb.rb * height; size = (video.fb.h * video.fb.rb - offs)/16; dest = (int*)video.fb.mphys;