# HG changeset patch # User a.parshin # Date 1406151138 -10800 # Node ID daf7807d0a8632be0eac7ffc5a29fac5bde85556 # Parent c10c639f83658ccd040b4518a5f137be9fa7bc71# Parent ea7748f4dc6022b0b11499e90984262b1f48ce92 Merge diff -r c10c639f8365 -r daf7807d0a86 Sprites.cpp --- a/Sprites.cpp Thu Jul 24 00:31:49 2014 +0300 +++ b/Sprites.cpp Thu Jul 24 00:32:18 2014 +0300 @@ -406,17 +406,9 @@ memcpy(pSpriteSFrames + num_mm6_frames + num_mm7_frames, (char *)data_mm8 + 8, mm8_frames_size); memcpy(pSpriteEFrames + num_mm6_frames + num_mm7_frames, (char *)data_mm8 + 8 + mm8_frames_size, 2 * num_mm8_eframes); - for (uint i = 0; i < num_mm7_frames; ++i) - pSpritePFrames[i] = &pSpriteSFrames[pSpriteEFrames[i]];//Uninitialized memory access - - for (uint i = num_mm7_frames; i < num_mm6_frames + num_mm7_frames; ++i) - pSpritePFrames[i] = &pSpriteSFrames[pSpriteEFrames[i] + num_mm7_frames]; - - for (uint i = num_mm6_frames + num_mm7_frames; i < num_mm6_frames + num_mm7_frames + num_mm8_frames; ++i) - pSpritePFrames[i] = &pSpriteSFrames[pSpriteEFrames[i] + num_mm6_frames + num_mm7_frames]; - - //for (uint i = 0; i < uNumSpriteFrames; ++i) - // pSpritePFrames[i] = &pSpriteSFrames[pSpriteEFrames[i]]; + //the original was using num_mmx_frames, but never accessed any element beyond num_mmx_eframes, but boing beyong eframes caused invalid memory accesses + for (uint i = 0; i < num_mm6_eframes + num_mm7_eframes + num_mm8_eframes; ++i) + pSpritePFrames[i] = &pSpriteSFrames[pSpriteEFrames[i]]; } //----- (0044DA92) --------------------------------------------------------