25 Sep
2023
25 Sep
'23
7:23 p.m.
Jeffrey Smith (@whydoubt) commented about dlls/gdiplus/tests/image.c:
} }
+INT compare_with_precision(const void *ptr1, const void *ptr2, size_t num, INT precision) +{ + if (ptr1 == NULL || ptr2 == NULL) + return ptr1 < ptr2 ? -1 : 1; + + for (size_t i = 0; i < num; i++) + { + unsigned char byte1 = *((unsigned char *)ptr1 + i); + unsigned char byte2 = *((unsigned char *)ptr2 + i); + + if ((byte1 < byte2 - precision) || (byte1 > byte2 + precision))
I believe the operations here could over/under-flow. Seems like that may cause problems. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3936#note_46694