diff options
author | Ben Campbell <ben@scumways.com> | 2016-12-09 10:41:17 +1300 |
---|---|---|
committer | Ben Campbell <ben@scumways.com> | 2016-12-19 10:09:22 +1300 |
commit | 0ff9295456a5fef1e3a42fce7a546bc20aef3632 (patch) | |
tree | ac9c77fb7cb5ede8b2525e9eb3c3a46177796b30 | |
parent | d9f69239ce1706f88ee7eaa3c65d939f3ce25723 (diff) | |
download | devil-0ff9295456a5fef1e3a42fce7a546bc20aef3632.tar.gz |
xpm: fixed bad memcpy sizes
Was using a sizeof(*byte) instead of sizeof(byte[4]). Would be fine on
32bit machines but with 64bit pointers it'd overrun 4 extra bytes.
-rw-r--r-- | DevIL/src-IL/src/il_xpm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/DevIL/src-IL/src/il_xpm.c b/DevIL/src-IL/src/il_xpm.c index 9ca847a4..8dd44b4f 100644 --- a/DevIL/src-IL/src/il_xpm.c +++ b/DevIL/src-IL/src/il_xpm.c @@ -205,7 +205,7 @@ void XpmInsertEntry(XPMHASHENTRY **Table, const ILubyte* Name, int Len, XpmPixel if (NewEntry != NULL) { NewEntry->Next = Table[Index]; memcpy(NewEntry->ColourName, Name, Len); - memcpy(NewEntry->ColourValue, Colour, sizeof(Colour)); + memcpy(NewEntry->ColourValue, Colour, sizeof(XpmPixel)); Table[Index] = NewEntry; } } @@ -222,7 +222,7 @@ void XpmGetEntry(XPMHASHENTRY **Table, const ILubyte* Name, int Len, XpmPixel Co Entry = Entry->Next; if (Entry != NULL) - memcpy(Colour, Entry->ColourValue, sizeof(Colour)); + memcpy(Colour, Entry->ColourValue, sizeof(XpmPixel)); } #endif //XPM_DONT_USE_HASHTABLE |