core, fix some bugs reported by ASAN

This commit is contained in:
kub 2024-02-14 23:36:43 +01:00
parent b5d8374c6a
commit b38c0ea6f9
2 changed files with 6 additions and 7 deletions

View file

@ -397,7 +397,7 @@ int PicoVideoFIFOHint(void)
// reset slot to start of scanline
vf->fifo_slot = 0;
// only need to refresh sprite position if we are synced
if (Pico.est.DrawScanline == Pico.m.scanline)
if (Pico.est.DrawScanline == Pico.m.scanline && !(pv->status & SR_VB))
PicoDrawRefreshSprites();
// if CPU is waiting for the bus, advance CPU and FIFO until bus is free