Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/sys/dev/splash Pull up following revision(s) (requested b...



details:   https://anonhg.NetBSD.org/src/rev/ca1703fc7774
branches:  netbsd-7
changeset: 799963:ca1703fc7774
user:      snj <snj%NetBSD.org@localhost>
date:      Sun Aug 28 04:31:19 2016 +0000

description:
Pull up following revision(s) (requested by khorben in ticket #1238):
        sys/dev/splash/splash.c: revision 1.13
Do not panic if the splash screen is bigger than the framebuffer
This fixes a kernel crash if the splash screen does not fit inside the
framebuffer. It should probably be truncated (and optionally centered)
instead, but this avoids a panic in the meantime.
Tested on NetBSD/amd64 with a vesa framebuffer.
 From Christian Koch (cfkoch@) of EdgeBSD; thanks!
XXX pull-up(s)

diffstat:

 sys/dev/splash/splash.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r 431351aa3b44 -r ca1703fc7774 sys/dev/splash/splash.c
--- a/sys/dev/splash/splash.c   Sun Aug 28 03:38:15 2016 +0000
+++ b/sys/dev/splash/splash.c   Sun Aug 28 04:31:19 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: splash.c,v 1.12 2012/06/02 14:24:00 martin Exp $ */
+/* $NetBSD: splash.c,v 1.12.14.1 2016/08/28 04:31:19 snj Exp $ */
 
 /*-
  * Copyright (c) 2006 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: splash.c,v 1.12 2012/06/02 14:24:00 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: splash.c,v 1.12.14.1 2016/08/28 04:31:19 snj Exp $");
 
 #include "opt_splash.h"
 
@@ -195,6 +195,14 @@
        aprint_debug("%s: splash loaded, width %d height %d comp %d\n",
            __func__, width, height, comp);
 
+       if ((width > si->si_width) || (height > si->si_height)) {
+               aprint_error(
+                       "WARNING: splash size (%dx%d) too big for framebuffer (%dx%d)\n",
+                       width, height, si->si_width, si->si_height);
+               stbi_image_free(data);
+               return EINVAL;
+       }
+
        /* XXX */
        if (flg & SPLASH_F_CENTER) {
                xoff = (si->si_width - width) / 2;



Home | Main Index | Thread Index | Old Index