From f48a56f6c09a177066c428ac03689c3f6c3de51f Mon Sep 17 00:00:00 2001 From: Yurii Zubrytskyi Date: Tue, 21 Nov 2023 08:15:13 -0800 Subject: [res] Fix the cookie index in OpenNonAsset() Previous change incorrectly set the output cookie index, forgetting to account for the -1 offset Bug: 312057285 Test: manual Change-Id: Ib4ce95a3084f7faf83ac4875184f331407a1bd50 --- libs/androidfw/AssetManager2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs/androidfw/AssetManager2.cpp') diff --git a/libs/androidfw/AssetManager2.cpp b/libs/androidfw/AssetManager2.cpp index d056248273b2..8748dab581bb 100644 --- a/libs/androidfw/AssetManager2.cpp +++ b/libs/androidfw/AssetManager2.cpp @@ -603,7 +603,7 @@ std::unique_ptr AssetManager2::OpenNonAsset(const std::string& filename, std::unique_ptr asset = assets->GetAssetsProvider()->Open(filename, mode); if (asset) { if (out_cookie != nullptr) { - *out_cookie = i; + *out_cookie = i - 1; } return asset; } -- cgit v1.2.3-59-g8ed1b