mirror of
https://github.com/GerbilSoft/rom-properties.git
synced 2025-06-18 19:45:41 -04:00
[librptexture] ImageDecoder::fromLinear32_ssse3(): Missed a 16-byte stride alignment check.
xtexconv includes a sample DDS that has stride == 15,076. Without this check, rpcli crashes due to the use of movdqa on an unaligned pointer. Reference: https://learn.microsoft.com/en-us/samples/microsoft/xbox-gdk-samples/xtexconv/
This commit is contained in:
parent
f6d9394da8
commit
f13bde810f
@ -3,7 +3,7 @@
|
||||
* ImageDecoder_Linear.cpp: Image decoding functions: Linear *
|
||||
* SSSE3-optimized version. *
|
||||
* *
|
||||
* Copyright (c) 2016-2024 by David Korth. *
|
||||
* Copyright (c) 2016-2025 by David Korth. *
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later *
|
||||
***************************************************************************/
|
||||
|
||||
@ -229,6 +229,10 @@ rp_image_ptr fromLinear32_ssse3(PixelFormat px_format,
|
||||
if (unlikely(stride % bytespp != 0 || stride < (width * bytespp))) {
|
||||
// Invalid stride.
|
||||
return nullptr;
|
||||
} else if (unlikely((stride % 16 != 0) && px_format != PixelFormat::Host_ARGB32)) {
|
||||
// Unaligned stride.
|
||||
// Use the C++ version.
|
||||
return fromLinear32_cpp(px_format, width, height, img_buf, img_siz, stride);
|
||||
}
|
||||
src_stride_adj = (stride / bytespp) - width;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user