Skip to content

Commit 44451e6

Browse files
committed
Fix incorrect failure code in screen_get_framebuffer_format
RenderingDevice::screen_get_framebuffer_format should return a value of type RenderingDevice::FramebufferFormatID which is an alias of int64_t but it returns Error::FAILED with a value of 1. The compiler does not complain because both types are integers but 1 corresponds to a valid FramebufferFormatID, meaning a certain failure condition is missed. This commit changes it to the correct value, INVALID_ID.
1 parent f50d7fa commit 44451e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

servers/rendering/rendering_device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4260,7 +4260,7 @@ RenderingDevice::FramebufferFormatID RenderingDevice::screen_get_framebuffer_for
42604260
_THREAD_SAFE_METHOD_
42614261

42624262
HashMap<DisplayServer::WindowID, RDD::SwapChainID>::ConstIterator it = screen_swap_chains.find(p_screen);
4263-
ERR_FAIL_COND_V_MSG(it == screen_swap_chains.end(), FAILED, "Screen was never prepared.");
4263+
ERR_FAIL_COND_V_MSG(it == screen_swap_chains.end(), INVALID_ID, "Screen was never prepared.");
42644264

42654265
DataFormat format = driver->swap_chain_get_format(it->value);
42664266
ERR_FAIL_COND_V(format == DATA_FORMAT_MAX, INVALID_ID);

0 commit comments

Comments
 (0)