blob: 684a79556518a2d2047e1997326750fedf00b2bd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
--- mozilla/image/decoders/nsIconDecoder.cpp
+++ mozilla/image/decoders/nsIconDecoder.cpp
@@ -89,17 +89,18 @@ nsIconDecoder::ReadRowOfPixels(const cha
{
MOZ_ASSERT(aLength % 4 == 0, "Rows should contain a multiple of four bytes");
auto result = mPipe.WritePixels<uint32_t>([&]() -> NextPixel<uint32_t> {
if (aLength == 0) {
return AsVariant(WriteState::NEED_MORE_DATA); // Done with this row.
}
- uint32_t pixel = *reinterpret_cast<const uint32_t*>(aData);
+ uint32_t pixel;
+ memcpy(&pixel, aData, 4);
aData += 4;
aLength -= 4;
return AsVariant(pixel);
});
MOZ_ASSERT(result != WriteState::FAILURE);
|