commit 1ba9d806f109eb58d669f01270ee564300948d18
parent 17c5069730feada06abfc1398c7634971373138d
Author: Lee Salzman <lsalzman@mozilla.com>
Date: Thu, 18 Dec 2025 18:35:22 +0000
Bug 2003989. r=ahale
Differential Revision: https://phabricator.services.mozilla.com/D275372
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/gfx/layers/SourceSurfaceSharedData.cpp b/gfx/layers/SourceSurfaceSharedData.cpp
@@ -79,6 +79,10 @@ void SourceSurfaceSharedDataWrapper::Init(SourceSurfaceSharedData* aSurface) {
bool SourceSurfaceSharedDataWrapper::EnsureMapped(size_t aLength) {
MOZ_ASSERT(!GetData());
+ if (mBufHandle.Size() < aLength) {
+ return false;
+ }
+
auto mapping = mBufHandle.Map();
while (!mapping) {
nsTArray<RefPtr<SourceSurfaceSharedDataWrapper>> expired;