summaryrefslogtreecommitdiff
path: root/src/video_core/surface.cpp
diff options
context:
space:
mode:
authorGravatar David Marcec2018-12-19 12:52:32 +1100
committerGravatar David Marcec2018-12-19 12:52:32 +1100
commitfdd649e2ef56ea473e253511d35fe6c10e0fb241 (patch)
tree82bf8e6a7cd1dd344c9bb0b3a728fc17c38de629 /src/video_core/surface.cpp
parentMerge pull request #1913 from MerryMage/default-fpcr (diff)
downloadyuzu-fdd649e2ef56ea473e253511d35fe6c10e0fb241.tar.gz
yuzu-fdd649e2ef56ea473e253511d35fe6c10e0fb241.tar.xz
yuzu-fdd649e2ef56ea473e253511d35fe6c10e0fb241.zip
Fixed uninitialized memory due to missing returns in canary
Functions which are suppose to crash on non canary builds usually don't return anything which lead to uninitialized memory being used.
Diffstat (limited to 'src/video_core/surface.cpp')
-rw-r--r--src/video_core/surface.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp
index 9582dd2ca..a97b1562b 100644
--- a/src/video_core/surface.cpp
+++ b/src/video_core/surface.cpp
@@ -65,6 +65,7 @@ PixelFormat PixelFormatFromDepthFormat(Tegra::DepthFormat format) {
65 default: 65 default:
66 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); 66 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
67 UNREACHABLE(); 67 UNREACHABLE();
68 return PixelFormat::S8Z24;
68 } 69 }
69} 70}
70 71
@@ -141,6 +142,7 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format)
141 default: 142 default:
142 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); 143 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
143 UNREACHABLE(); 144 UNREACHABLE();
145 return PixelFormat::RGBA8_SRGB;
144 } 146 }
145} 147}
146 148
@@ -327,6 +329,7 @@ PixelFormat PixelFormatFromTextureFormat(Tegra::Texture::TextureFormat format,
327 LOG_CRITICAL(HW_GPU, "Unimplemented format={}, component_type={}", static_cast<u32>(format), 329 LOG_CRITICAL(HW_GPU, "Unimplemented format={}, component_type={}", static_cast<u32>(format),
328 static_cast<u32>(component_type)); 330 static_cast<u32>(component_type));
329 UNREACHABLE(); 331 UNREACHABLE();
332 return PixelFormat::ABGR8U;
330 } 333 }
331} 334}
332 335
@@ -346,6 +349,7 @@ ComponentType ComponentTypeFromTexture(Tegra::Texture::ComponentType type) {
346 default: 349 default:
347 LOG_CRITICAL(HW_GPU, "Unimplemented component type={}", static_cast<u32>(type)); 350 LOG_CRITICAL(HW_GPU, "Unimplemented component type={}", static_cast<u32>(type));
348 UNREACHABLE(); 351 UNREACHABLE();
352 return ComponentType::UNorm;
349 } 353 }
350} 354}
351 355
@@ -393,6 +397,7 @@ ComponentType ComponentTypeFromRenderTarget(Tegra::RenderTargetFormat format) {
393 default: 397 default:
394 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); 398 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
395 UNREACHABLE(); 399 UNREACHABLE();
400 return ComponentType::UNorm;
396 } 401 }
397} 402}
398 403
@@ -403,6 +408,7 @@ PixelFormat PixelFormatFromGPUPixelFormat(Tegra::FramebufferConfig::PixelFormat
403 default: 408 default:
404 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); 409 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
405 UNREACHABLE(); 410 UNREACHABLE();
411 return PixelFormat::ABGR8U;
406 } 412 }
407} 413}
408 414
@@ -418,6 +424,7 @@ ComponentType ComponentTypeFromDepthFormat(Tegra::DepthFormat format) {
418 default: 424 default:
419 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); 425 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
420 UNREACHABLE(); 426 UNREACHABLE();
427 return ComponentType::UNorm;
421 } 428 }
422} 429}
423 430