Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/rasops Oops, for rasops_copycols(), we cannot use me...



details:   https://anonhg.NetBSD.org/src/rev/48869558c81e
branches:  trunk
changeset: 1002481:48869558c81e
user:      rin <rin%NetBSD.org@localhost>
date:      Fri Aug 02 04:18:15 2019 +0000

description:
Oops, for rasops_copycols(), we cannot use memmove even if src == dst.
On the other hand, memmove is safe for rasops_copyrows().

diffstat:

 sys/dev/rasops/rasops.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (34 lines):

diff -r a05f3c16b327 -r 48869558c81e sys/dev/rasops/rasops.c
--- a/sys/dev/rasops/rasops.c   Fri Aug 02 02:17:46 2019 +0000
+++ b/sys/dev/rasops/rasops.c   Fri Aug 02 04:18:15 2019 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: rasops.c,v 1.105 2019/07/31 04:45:44 rin Exp $        */
+/*      $NetBSD: rasops.c,v 1.106 2019/08/02 04:18:15 rin Exp $        */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.105 2019/07/31 04:45:44 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.106 2019/08/02 04:18:15 rin Exp $");
 
 #include "opt_rasops.h"
 #include "rasops_glue.h"
@@ -779,12 +779,12 @@
                hp = ri->ri_hwbits + row + dst * ri->ri_xscale;
 
        while (height--) {
-               memcpy(dp, sp, num);
-               dp += ri->ri_stride;
+               memmove(dp, sp, num);
                if (ri->ri_hwbits) {
-                       memcpy(hp, sp, num);
+                       memcpy(hp, dp, num);
                        hp += ri->ri_stride;
                }
+               dp += ri->ri_stride;
                sp += ri->ri_stride;
        }
 }



Home | Main Index | Thread Index | Old Index