diff options
author | Ankit Meel <ankitjmeel@gmail.com> | 2020-10-01 09:25:14 +0300 |
---|---|---|
committer | Ankit Meel <ankitjmeel@gmail.com> | 2020-10-01 11:56:45 +0300 |
commit | 63c906e0a7e59152601435bac2d06fb1b6df6592 (patch) | |
tree | 197ffb1ea4cd5269714c9df6cc6f57d1816c1fe9 | |
parent | a4e14c3bfdb7dca037ae17bbd3897ef5d8a409b9 (diff) |
Fix T81340: UBSan: addition of unsigned offset causes overflow
The warning:
runtime error: addition of unsigned offset to 0x61a0000b22d8
overflowed to 0x61a0000b22b8
Fix T81340 (partially)
Reviewed By: campbellbarton
Maniphest Tasks: T81340
Differential Revision: https://developer.blender.org/D9063
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ed35b5c5f8f..1072cd3686e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -284,7 +284,7 @@ typedef struct BHeadN { struct BHead bhead; } BHeadN; -#define BHEADN_FROM_BHEAD(bh) ((BHeadN *)POINTER_OFFSET(bh, -offsetof(BHeadN, bhead))) +#define BHEADN_FROM_BHEAD(bh) ((BHeadN *)POINTER_OFFSET(bh, -(int)offsetof(BHeadN, bhead))) /* We could change this in the future, for now it's simplest if only data is delayed * because ID names are used in lookup tables. */ |