Previous 199869 Revisions Next

r28773 Friday 21st March, 2014 at 01:54:57 UTC by Barry Rodewald
hd61830: added bitmap bounds checking, fixes nbmj8688 LCD games crash/assert (no whatsnew)
[src/emu/video]hd61830.c

trunk/src/emu/video/hd61830.c
r28772r28773
379379
380380      for (int x = 0; x < m_hp; x++)
381381      {
382         bitmap.pix16(y, (sx * m_hp) + x) = BIT(data1, x);
383         assert(y >= 0 && y < bitmap.height());
384         assert(((sx * m_hp) + x + m_hp) >= 0 && ((sx * m_hp) + x + m_hp) < bitmap.width());
385         bitmap.pix16(y, (sx * m_hp) + x + m_hp) = BIT(data2, x);
382         if(y >= 0 && y < bitmap.height())
383         {
384            if(((sx * m_hp) + x) >= 0 && ((sx * m_hp) + x) < bitmap.width())
385               bitmap.pix16(y, (sx * m_hp) + x) = BIT(data1, x);
386            if(((sx * m_hp) + x + m_hp) >= 0 && ((sx * m_hp) + x + m_hp) < bitmap.width())
387               bitmap.pix16(y, (sx * m_hp) + x + m_hp) = BIT(data2, x);
388         }
386389      }
387390   }
388391   return ra;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team