mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 22:28:22 +01:00
fix endian problems in pattern copy
CopyBlock8b() was over-using memcpy() of 16b values. BUG=webp:393,webp:512 Change-Id: Id56f10d334b9a453fbcf50dabfaa63529bcff7e5 (cherry picked from commit211f37ee63
) (cherry picked from commit667d17a8a4
)
This commit is contained in:
parent
b5e0b231c1
commit
641fbb5e89
@ -884,7 +884,11 @@ static WEBP_INLINE void CopyBlock8b(uint8_t* const dst, int dist, int length) {
|
|||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
#if !defined(WORDS_BIGENDIAN)
|
||||||
memcpy(&pattern, src, sizeof(uint16_t));
|
memcpy(&pattern, src, sizeof(uint16_t));
|
||||||
|
#else
|
||||||
|
pattern = ((uint32_t)src[0] << 8) | src[1];
|
||||||
|
#endif
|
||||||
#if defined(__arm__) || defined(_M_ARM)
|
#if defined(__arm__) || defined(_M_ARM)
|
||||||
pattern |= pattern << 16;
|
pattern |= pattern << 16;
|
||||||
#elif defined(WEBP_USE_MIPS_DSP_R2)
|
#elif defined(WEBP_USE_MIPS_DSP_R2)
|
||||||
|
Loading…
Reference in New Issue
Block a user