tiffdump: avoid unaligned memory access

fixes #143
fixes #144
This commit is contained in:
Thomas Bernard 2020-03-24 00:18:32 +01:00
parent 6c63f17749
commit 37121e1574
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C

View File

@ -451,7 +451,7 @@ ReadDirectory(int fd, unsigned int ix, uint64 off)
{ {
datafits = 0; datafits = 0;
datamem = NULL; datamem = NULL;
dataoffset = *(uint64*)dp; memcpy(&dataoffset, dp, sizeof(uint64));
if (swabflag) if (swabflag)
TIFFSwabLong8(&dataoffset); TIFFSwabLong8(&dataoffset);
} }