Restore safe reinterpret_cast in clipboard converter
This commit is contained in:
parent
fb5e2bb171
commit
055370412c
|
@ -127,7 +127,7 @@ XWindowsClipboardAnyBitmapConverter::fromIClipboard(const String& bmp) const
|
|||
{
|
||||
// fill BMP info header with native-endian data
|
||||
CBMPInfoHeader infoHeader;
|
||||
const UInt8* rawBMPInfoHeader = static_cast<const UInt8*>(bmp.data());
|
||||
const UInt8* rawBMPInfoHeader = reinterpret_cast<const UInt8*>(bmp.data());
|
||||
infoHeader.biSize = fromLEU32(rawBMPInfoHeader + 0);
|
||||
infoHeader.biWidth = fromLES32(rawBMPInfoHeader + 4);
|
||||
infoHeader.biHeight = fromLES32(rawBMPInfoHeader + 8);
|
||||
|
@ -186,6 +186,6 @@ XWindowsClipboardAnyBitmapConverter::toIClipboard(const String& image) const
|
|||
toLE(dst, static_cast<UInt32>(0));
|
||||
|
||||
// construct image
|
||||
return String(static_cast<const char*>(infoHeader),
|
||||
return String(reinterpret_cast<const char*>(infoHeader),
|
||||
sizeof(infoHeader)) + rawBMP;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue