Skip to content

Commit 9a59dbd

Browse files
authored
ASAN Issue (#528)
On MSVC I get a ``` ==9952==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges [0x11e8718f6e00,0x11e8718f6e78) and [0x11e8718f6e18, 0x11e8718f6e90) overlap ``` Since the CRT memcpy memory is not allowed to overlap (see: https://learn.microsoft.com/en-us/cpp/sanitizers/error-memcpy-param-overlap?view=msvc-170 ) And SDL_memcpy uses memcpy by default.
1 parent 5208d1c commit 9a59dbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/SDL_renderer_textengine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ static bool ResolveMissingGlyphs(TTF_RendererTextEngineData *enginedata, AtlasTe
367367
// Remove this from the missing entries
368368
--num_missing;
369369
if (i < num_missing) {
370-
SDL_memcpy(&missing[i], &missing[i+1], (num_missing - i) * sizeof(missing[i]));
370+
SDL_memmove(&missing[i], &missing[i + 1], (num_missing - i) * sizeof(missing[i]));
371371
}
372372
}
373373
if (num_missing == 0) {

0 commit comments

Comments
 (0)