X Tutup
Skip to content

SCUMM: HE: Fix alloc-dealloc mismatch in ResExtractor#6320

Merged
bluegr merged 1 commit intoscummvm:masterfrom
tunnelsociety:he-allocmismatch
Dec 16, 2024
Merged

SCUMM: HE: Fix alloc-dealloc mismatch in ResExtractor#6320
bluegr merged 1 commit intoscummvm:masterfrom
tunnelsociety:he-allocmismatch

Conversation

@tunnelsociety
Copy link
Contributor

CachedCursor->bitmap and palette are allocated via new[] in ::extractResource.

ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs free) on 0x619000348080
    #0 0x7fea95eb76a8 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:52
    #1 0x55d6c546b996 in Scumm::ResExtractor::~ResExtractor() engines/scumm/he/resource_he.cpp:52
[...]
0x619000348080 is located 0 bytes inside of 1024-byte region [0x619000348080,0x619000348480)
allocated by thread T0 here:
    #0 0x7fea95eb9628 in operator new[](unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:98
    #1 0x55d6c546ce70 in Scumm::Win32ResExtractor::extractResource(int, Scumm::ResExtractor::CachedCursor*) engines/scumm/he/resource_he.cpp:140
[...]

CachedCursor->bitmap and palette are allocated via new[] in ::extractResource
@bluegr
Copy link
Member

bluegr commented Dec 16, 2024

Nice catch, thanks!

@bluegr bluegr merged commit dc0207d into scummvm:master Dec 16, 2024
@tunnelsociety tunnelsociety deleted the he-allocmismatch branch December 17, 2024 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup