VIDEO: Fix HNM decoding

Bytes are both read before written
This commit is contained in:
Le Philousophe 2021-04-11 19:17:36 +02:00 committed by Filippos Karapetis
parent f1e90ada2f
commit 0953a690f4

View File

@ -349,10 +349,15 @@ void HNMDecoder::HNM4VideoTrack::decodeInterframe(Common::SeekableReadStream *st
if (swap)
SWAP(shft1, shft2);
int src_inc = backward ? -2 : 2;
while (count--) {
_frameBufferC[currentPos++] = ptr[offset + shft1];
_frameBufferC[currentPos++] = ptr[offset + shft2];
offset += backward ? -2 : 2;
byte b0 = ptr[offset + shft1];
byte b1 = ptr[offset + shft2];
_frameBufferC[currentPos++] = b0;
_frameBufferC[currentPos++] = b1;
offset += src_inc;
}
}
}