1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

Fix out of range read/write in _copyPixelsFromRdram when address in input array is outside of current frame buffer.

This commit is contained in:
Sergey Lipskiy 2016-03-01 16:49:54 +06:00
parent 8f952921a0
commit 235530cec8

View File

@ -1620,9 +1620,13 @@ bool _copyPixelsFromRdram(u32 _address, const vector<u32> & _vecAddress, u32* _d
u32 summ = 0;
u32 idx, w, h;
for (size_t i = 0; i < numPixels; ++i) {
if (_vecAddress[i] < _address)
return false;
idx = (_vecAddress[i] - _address) / szPixel;
w = idx % _width;
h = idx / _width;
if (h > _height)
return false;
col = src[idx];
summ += col;
_dst[(w + (_height - h)*_width) ^ _xor] = converter(col, _bCFB);