From e4a95b2c26deec20e82019154051cd7909214a42 Mon Sep 17 00:00:00 2001 From: nmzik Date: Sun, 16 Aug 2026 02:33:10 +0200 Subject: [PATCH] playgo: reject missing package metadata --- src/libs/libPlayGo.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/libs/libPlayGo.cpp b/src/libs/libPlayGo.cpp index b7c4346b8..113cd005b 100644 --- a/src/libs/libPlayGo.cpp +++ b/src/libs/libPlayGo.cpp @@ -52,14 +52,7 @@ union PlayGoOptionalChunk { }; static bool ensure_chunks_loaded() { - if (g_chunks_num != 0) { - return true; - } - if (!Loader::SystemContentGetChunksNum(&g_chunks_num)) { - LOGF("Warning: assume that chunks count is 1\n"); - g_chunks_num = 1; - } - return g_chunks_num != 0; + return g_chunks_num != 0 || Loader::SystemContentGetChunksNum(&g_chunks_num); } static bool is_valid_chunk(uint16_t chunk_id) { @@ -121,11 +114,12 @@ int KYTY_SYSV_ABI PlayGoOpen(int* out_handle, const void* param) { if (param != nullptr) { return PLAYGO_ERROR_INVALID_ARGUMENT; } + if (!ensure_chunks_loaded()) { + return PLAYGO_ERROR_NOT_SUPPORT_PLAYGO; + } *out_handle = PLAYGO_HANDLE; - ensure_chunks_loaded(); - return OK; }