socsvn commit: r271437 - soc2014/seiya/bootsplash/sys/dev/fb
seiya at FreeBSD.org
seiya at FreeBSD.org
Sun Jul 27 05:33:40 UTC 2014
Author: seiya
Date: Sun Jul 27 05:33:39 2014
New Revision: 271437
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=271437
Log:
fix a bug
Modified:
soc2014/seiya/bootsplash/sys/dev/fb/bmp.c
Modified: soc2014/seiya/bootsplash/sys/dev/fb/bmp.c
==============================================================================
--- soc2014/seiya/bootsplash/sys/dev/fb/bmp.c Sat Jul 26 21:33:17 2014 (r271436)
+++ soc2014/seiya/bootsplash/sys/dev/fb/bmp.c Sun Jul 27 05:33:39 2014 (r271437)
@@ -262,8 +262,8 @@
/*
* range check to avoid explosions
*/
- if ((x_origin < 0) || (x_origin + count >= info->swidth) ||
- (y < 0) || (y >= info->sheight))
+ if ((x_origin < 0) || (x_origin + count > info->swidth) ||
+ (y < 0) || (y > info->sheight))
return;
/*
@@ -467,11 +467,12 @@
* two colour indexes to alternate between for the run
*/
if (*info->index) {
- count = min(sx + width - x, *info->index);
- bmp_draw_line(info, y, x, count, *(info->index+1));
- x += count;
+ if(sx + width - x > 0) {
+ count = min(sx + width - x, *info->index);
+ bmp_draw_line(info, y, x, count, *(info->index+1));
+ x += count;
+ }
info->index += 2;
-
/*
* A leading zero is an escape; it may signal the end of the
* bitmap, a cursor move, or some absolute data.
@@ -494,7 +495,6 @@
i++, x++){
bmp_SetPix(info, x, y, *(info->index + 2 + i));
}
-
info->index += 2 + i + (i & 1);
break;
}
More information about the svn-soc-all
mailing list