Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Jul 2014 05:33:39 GMT
From:      seiya@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r271437 - soc2014/seiya/bootsplash/sys/dev/fb
Message-ID:  <201407270533.s6R5XdmE016611@socsvn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 			}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407270533.s6R5XdmE016611>