bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#56553: 29.0.50; ASAN error with fringe bitmaps on NS


From: Po Lu
Subject: bug#56553: 29.0.50; ASAN error with fringe bitmaps on NS
Date: Fri, 15 Jul 2022 16:23:09 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> If we insert the max values for x, y, w, h in the original, we have
>
>    int byte = (12 - 1) * (16/8 + (16%8 != 0 ? 1 : 0) + (16 - 1)/8
>
> which is 
>
>                 = 11 * (2 + (0 ? 1 : 0) + 15/8
>                 = 11 * 2 + 1
>               = 23
>
> which would be the right /byte/ to access in the bitmap.  But
> "bits[byte]" doesn't access the 23rd byte of the bitmap but the 23rd
> unsigned short, which is byte 46 and 47.  That cannot possibly be
> right, or?

Yes, you're right here.  I think that code does want to access the
individual bytes.

> The NSBezierPath stuff I don't know.  I gather, from a short look at
> the docs, that one can "record" stuff that should be drawn in such an
> object.  The path can then later be used to actually draw.  Looks a
> tad complicated to me to draw single pixels as a rectangle of size 1,
> but what do I know...

Believe it or not, it's the only way to record such a pixel without
resulting in annoying scaling artifacts from the OS trying to scale the
image up to monitor resolution.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]