Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 2111c09233dbeb934af083e7c65552a6a419e2f3
https://github.com/WebKit/WebKit/commit/2111c09233dbeb934af083e7c65552a6a419e2f3
Author: Nikolas Zimmermann <[email protected]>
Date: 2025-06-24 (Tue, 24 Jun 2025)
Changed paths:
M Source/WebCore/platform/graphics/gbm/MemoryMappedGPUBuffer.cpp
Log Message:
-----------
[GTK][WPE] MemoryMappedGPUBuffer::mapIfNeeded() does not handle mmap() errors
properly
https://bugs.webkit.org/show_bug.cgi?id=294896
Reviewed by Carlos Garcia Campos.
If mmap() fails MAP_FAILED is returned, which is a special constant
(e.g. (void*)-1, 0xfffff...) indicating the error. We currently return
false from mapIfNeeded() to indicate that the mapping failed, but later
on check if the mapping succeded, by invoking `isMapped()`, which checks
if m_mappedData is non-null, which is the case even if mmap() failed, as
we incorrectly store the special constant in m_mappedData -- the address
of the memory-mapped region. Fix that problem by properly resetting
m_mappedData to nullptr, if mmap() failed.
Covered by existing tests -- they currently crash if mmap() mode fails
instead of falling back to OpenGL texture updates.
* Source/WebCore/platform/graphics/gbm/MemoryMappedGPUBuffer.cpp:
(WebCore::MemoryMappedGPUBuffer::mapIfNeeded):
Canonical link: https://commits.webkit.org/296562@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes