Previous 199869 Revisions Next

r31548 Thursday 7th August, 2014 at 16:00:51 UTC by hap
fix src/mame/video/atarimo.c:225:24: runtime error: index -4 out of bounds for type 'UINT16 [4096]'
[src/mame/video]atarimo.c

trunk/src/mame/video/atarimo.c
r31547r31548
215215      // if this matches the last link, we don't need to re-process the list
216216      build_active_list(link);
217217
218      // initialize the parameters
219      m_next_xpos = 123456;
220
221      // safety check
222      if (m_activelist == m_activelast)
223         continue;
224
218225      // set the start and end points
219226      UINT16 *first, *last;
220227      int step;
221228      if (m_reverse)
222229      {
223230         first = m_activelast - 4;
224         // TODO: this sets last to index m_activelist[-4]
225         last = m_activelist - 4;
231         last = m_activelist;
226232         step = -4;
227233      }
228234      else
229235      {
230236         first = m_activelist;
231         last = m_activelast;
237         last = m_activelast - 4;
232238         step = 4;
233239      }
234240
235      // initialize the parameters
236      m_next_xpos = 123456;
237
238241      // render the mos
239      for (UINT16 *current = first; current != last; current += step)
242      for (UINT16 *current = first; ; current += step)
243      {
240244         render_object(bitmap, bandclip, current);
245         if (current == last)
246            break;
247      }
241248   }
242249}
243250

Previous 199869 Revisions Next


© 1997-2024 The MAME Team