Restore safe reinterpret_casts in OSXClipboardBMPConverter

This commit is contained in:
Andrew Nelless 2016-09-13 11:14:40 +01:00
parent 23cf284a66
commit 8072594008
1 changed files with 2 additions and 2 deletions

View File

@ -104,7 +104,7 @@ OSXClipboardBMPConverter::fromIClipboard(const String& bmp) const
toLE(dst, static_cast<UInt16>(0)); toLE(dst, static_cast<UInt16>(0));
toLE(dst, static_cast<UInt16>(0)); toLE(dst, static_cast<UInt16>(0));
toLE(dst, static_cast<UInt32>(14 + 40)); toLE(dst, static_cast<UInt32>(14 + 40));
return String(static_cast<const char*>(header), 14) + bmp; return String(reinterpret_cast<const char*>(header), 14) + bmp;
} }
String String
@ -116,7 +116,7 @@ OSXClipboardBMPConverter::toIClipboard(const String& bmp) const
} }
// check BMP file header // check BMP file header
const UInt8* rawBMPHeader = static_cast<const UInt8*>(bmp.data()); const UInt8* rawBMPHeader = reinterpret_cast<const UInt8*>(bmp.data());
if (rawBMPHeader[0] != 'B' || rawBMPHeader[1] != 'M') { if (rawBMPHeader[0] != 'B' || rawBMPHeader[1] != 'M') {
return String(); return String();
} }