From: Eli Zaretskii Date: Thu, 19 Sep 2013 13:51:38 +0000 (+0300) Subject: Fix a blatant bug in restore_current_matrix. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1328^2~38 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2fa833dafe89503e3444943a76206e056100e71a;p=emacs.git Fix a blatant bug in restore_current_matrix. --- 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],