Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mac68k/mac68k Sanity check and set the framebuffer ...



details:   https://anonhg.NetBSD.org/src/rev/bff9225e2b2d
branches:  trunk
changeset: 372782:bff9225e2b2d
user:      nat <nat%NetBSD.org@localhost>
date:      Mon Dec 26 01:05:35 2022 +0000

description:
Sanity check and set the framebuffer length if necessary.

Addresses PR 57126.

diffstat:

 sys/arch/mac68k/mac68k/machdep.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 97ed29f0829a -r bff9225e2b2d sys/arch/mac68k/mac68k/machdep.c
--- a/sys/arch/mac68k/mac68k/machdep.c  Sun Dec 25 23:58:50 2022 +0000
+++ b/sys/arch/mac68k/mac68k/machdep.c  Mon Dec 26 01:05:35 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.363 2021/10/09 20:00:41 tsutsui Exp $    */
+/*     $NetBSD: machdep.c,v 1.364 2022/12/26 01:05:35 nat Exp $        */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.363 2021/10/09 20:00:41 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.364 2022/12/26 01:05:35 nat Exp $");
 
 #include "opt_adb.h"
 #include "opt_compat_netbsd.h"
@@ -2616,6 +2616,10 @@
                            mac68k_video.mv_len, mac68k_video.mv_len);
                }
        }
+       /* mv_len sanity check */
+       int reqsize = mac68k_video.mv_height * mac68k_video.mv_stride;
+       if (mac68k_video.mv_len != 0 && mac68k_video.mv_len < reqsize)
+               mac68k_video.mv_len = reqsize;
 
        return load_addr;       /* Return physical address of logical 0 */
 }



Home | Main Index | Thread Index | Old Index