From 2fa833dafe89503e3444943a76206e056100e71a Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 19 Sep 2013 16:51:38 +0300 Subject: [PATCH] Fix a blatant bug in restore_current_matrix. --- src/dispnew.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dispnew.c b/src/dispnew.c index f1df96d75a6..0a9ce116ebb 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -1971,7 +1971,7 @@ restore_current_matrix (struct frame *f, struct glyph_matrix *saved) memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA], nbytes); to->used[TEXT_AREA] = from->used[TEXT_AREA]; xfree (from->glyphs[TEXT_AREA]); - nbytes = from->used[LEFT_MARGIN_AREA]; + nbytes = from->used[LEFT_MARGIN_AREA] * sizeof (struct glyph); if (nbytes) { memcpy (to->glyphs[LEFT_MARGIN_AREA], @@ -1981,7 +1981,7 @@ restore_current_matrix (struct frame *f, struct glyph_matrix *saved) } else to->used[LEFT_MARGIN_AREA] = 0; - nbytes = from->used[RIGHT_MARGIN_AREA]; + nbytes = from->used[RIGHT_MARGIN_AREA] * sizeof (struct glyph); if (nbytes) { memcpy (to->glyphs[RIGHT_MARGIN_AREA], -- 2.39.2