[Fix] (MG_Impl/Buffer): Fix incorrect return outside if.

This commit is contained in:
BZLZHH
2025-08-05 18:58:26 +08:00
parent e8af08aff0
commit a696fb2350
+2 -1
View File
@@ -271,12 +271,13 @@ namespace MobileGL {
if (readBufferObject == writeBufferObject) { if (readBufferObject == writeBufferObject) {
if ((readOffset <= writeOffset && readOffset + size > writeOffset) || if ((readOffset <= writeOffset && readOffset + size > writeOffset) ||
(writeOffset <= readOffset && writeOffset + size > readOffset)) (writeOffset <= readOffset && writeOffset + size > readOffset)) {
MG_State::pGLContext->RecordError(ErrorCode::InvalidValue, MG_State::pGLContext->RecordError(ErrorCode::InvalidValue,
MakeShared<GenericErrorInfo>("MG_Impl/GLImpl", "CopyBufferSubData_State", MakeShared<GenericErrorInfo>("MG_Impl/GLImpl", "CopyBufferSubData_State",
"Source and destination buffers overlap in the specified ranges.")); "Source and destination buffers overlap in the specified ranges."));
return; return;
} }
}
auto isIllegallyMapped = [](const SharedPtr<MG_State::GLState::BufferObject>& buffer) { auto isIllegallyMapped = [](const SharedPtr<MG_State::GLState::BufferObject>& buffer) {
return buffer->IsMapped() && !Any(buffer->GetMappingAccess() & BufferMappingAccessBit::Persistent); return buffer->IsMapped() && !Any(buffer->GetMappingAccess() & BufferMappingAccessBit::Persistent);