core, fix rendering copy buffer overlap reported from asan

This commit is contained in:
kub 2021-10-16 10:05:04 +02:00
parent 2dacba5235
commit d2e3f475ff
2 changed files with 40 additions and 3 deletions

View file

@ -132,8 +132,12 @@ void blockcpy_or(void *dst, void *src, size_t n, int pat);
void blockcpy_or(void *dst, void *src, size_t n, int pat)
{
unsigned char *pd = dst, *ps = src;
for (; n; n--)
*pd++ = (unsigned char) (*ps++ | pat);
if (dst > src) {
for (pd += n, ps += n; n; n--)
*--pd = (unsigned char) (*--ps | pat);
} else
for (; n; n--)
*pd++ = (unsigned char) (*ps++ | pat);
}
#define blockcpy memmove
#endif
@ -2019,7 +2023,6 @@ void PicoDrawSetOutFormat(pdso_t which, int use_32x_line_mode)
{
case PDF_8BIT:
FinalizeLine = FinalizeLine8bit;
PicoDrawSetInternalBuf(Pico.est.Draw2FB, 328);
break;
case PDF_RGB555: