mirror of
https://github.com/yawut/SDL.git
synced 2026-04-21 16:17:28 -05:00
Fixed crash if the input data pitch is larger than the locked texture pitch
This commit is contained in:
parent
e250736ffe
commit
7eb65fd8d2
|
|
@ -1009,6 +1009,12 @@ D3D_UpdateTextureInternal(IDirect3DTexture9 *texture, Uint32 format, SDL_bool fu
|
|||
if (length == pitch && length == locked.Pitch) {
|
||||
SDL_memcpy(dst, src, length*h);
|
||||
} else {
|
||||
if (length > pitch) {
|
||||
length = pitch;
|
||||
}
|
||||
if (length > locked.Pitch) {
|
||||
length = locked.Pitch;
|
||||
}
|
||||
for (row = 0; row < h; ++row) {
|
||||
SDL_memcpy(dst, src, length);
|
||||
src += pitch;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user