From owner-svn-soc-all@FreeBSD.ORG Sun Jul 27 05:33:40 2014 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49683443 for ; Sun, 27 Jul 2014 05:33:40 +0000 (UTC) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 364862733 for ; Sun, 27 Jul 2014 05:33:40 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6R5Xe9S016724 for ; Sun, 27 Jul 2014 05:33:40 GMT (envelope-from seiya@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.8/8.14.8/Submit) id s6R5XdmE016611 for svn-soc-all@FreeBSD.org; Sun, 27 Jul 2014 05:33:39 GMT (envelope-from seiya@FreeBSD.org) Date: Sun, 27 Jul 2014 05:33:39 GMT Message-Id: <201407270533.s6R5XdmE016611@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to seiya@FreeBSD.org using -f From: seiya@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r271437 - soc2014/seiya/bootsplash/sys/dev/fb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jul 2014 05:33:40 -0000 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; }