For starters, don't trust this code. It looks sketchy to me. Put some breakpoints in BMPImg::LoadBmpRLE8() and make sure it isn't hitting any weird cases.
This looks especially suspect:
case 2: // Reposition, Never used
break;
I'd double-check that that case isn't needed in your BMPs--reading about the file format (e.g.,
here) doesn't suggest that it is actually never used; it may simply be a case the author chose not to handle because his image tools did not export BMPs with that indicator.
Also:
if(iIndex>iDataSize) // Stop if image size exceeded.
iDcode=0;
That seems like it should be reporting a warning or assertion failed if not an explicit hard failure case; if image size is exceeded, the program clearly failed in either calculating the image size or reading the data.
Honestly, if you're trying to write your own image loader, you should start by reading the file format spec, and then actually write your own code instead of copying something else. Or if that sounds like a lot of reinventing the wheel, don't write your own image loader. Find a library that does what you need and has been proven in other people's games, and use that instead.