From dbeb8cfbec5bc3a87dfc8ab93ad8d5dab27b1389 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Fri, 12 Apr 2024 21:42:12 +0200 Subject: [PATCH] cellSysutilAvc2Load_shared: simplify max_video_windows check --- rpcs3/Emu/Cell/Modules/cellSysutilAvc2.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.cpp b/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.cpp index fe40ec673d..0607f6f77b 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.cpp @@ -776,19 +776,10 @@ error_code cellSysutilAvc2Load_shared(SceNpMatching2ContextId ctx_id, u32 contai return CELL_AVC2_ERROR_INVALID_ARGUMENT; } - if (init_param->video_param.frame_mode == CELL_SYSUTIL_AVC2_FRAME_MODE_NORMAL) + if (init_param->video_param.max_video_windows == 0 || + init_param->video_param.max_video_windows > (init_param->video_param.frame_mode == CELL_SYSUTIL_AVC2_FRAME_MODE_NORMAL ? 6 : 16)) { - if (init_param->video_param.max_video_windows == 0 || init_param->video_param.max_video_windows > 6) - { - return CELL_AVC2_ERROR_INVALID_ARGUMENT; - } - } - else - { - if (init_param->video_param.max_video_windows == 0 || init_param->video_param.max_video_windows > 16) - { - return CELL_AVC2_ERROR_INVALID_ARGUMENT; - } + return CELL_AVC2_ERROR_INVALID_ARGUMENT; } if (init_param->video_param.max_video_bitrate < 1000 || init_param->video_param.max_video_bitrate > 512000)