mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-04-10 18:31:33 -06:00
Check buffer size
This commit is contained in:
parent
90a6904731
commit
5ddf6fc09b
@ -13,6 +13,7 @@ namespace camera
|
||||
{
|
||||
constexpr unsigned CAMERA_WIDTH = 640;
|
||||
constexpr unsigned CAMERA_HEIGHT = 480;
|
||||
constexpr unsigned CAMERA_PITCH = 768;
|
||||
|
||||
enum CAMStatus : sint32
|
||||
{
|
||||
@ -247,6 +248,7 @@ namespace camera
|
||||
return CAM_STATUS_INVALID_HANDLE;
|
||||
if (!targetSurface || targetSurface->data.IsNull() || targetSurface->size < 1)
|
||||
return CAM_STATUS_INVALID_ARG;
|
||||
cemu_assert_debug(targetSurface->size >= ((CAMERA_HEIGHT * CAMERA_PITCH * 3) >> 1));
|
||||
auto lock = std::scoped_lock(s_instance.mutex);
|
||||
if (!s_instance.initialized)
|
||||
return CAM_STATUS_UNINITIALIZED;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user