fix out of bounds priority check

This commit is contained in:
hap 2015-08-15 03:39:36 +02:00
parent eb1b330bcc
commit 0ceb2f6c8e

View File

@ -259,12 +259,12 @@ void atari_motion_objects_device::apply_stain(bitmap_ind16 &bitmap, UINT16 *pf,
{
const UINT16 START_MARKER = ((4 << PRIORITY_SHIFT) | 2);
const UINT16 END_MARKER = ((4 << PRIORITY_SHIFT) | 4);
int offnext = 0;
bool offnext = false;
for ( ; x < bitmap.width(); x++)
{
pf[x] |= 0x400;
if (offnext != 0 && (mo[x] & START_MARKER) != START_MARKER)
if (mo[x] == 0xffff || (offnext && (mo[x] & START_MARKER) != START_MARKER))
break;
offnext = ((mo[x] & END_MARKER) == END_MARKER);
}