aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-11-18 23:05:57 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-11-18 23:05:57 +0000
commitfc7489973cccb411e2472963801e652ca1500ab5 (patch)
tree869249bbe6844741362dde911c3ed32947641cb8
parenta87dd6178cc6a58ab0ebc9dafbbe171017e1eebf (diff)
parent6d369451868ce71618144c4f4bd645ae48f0d1c5 (diff)
downloadgptfdisk-fc7489973cccb411e2472963801e652ca1500ab5.tar.gz
Merge cherrypicks of [13083486, 13083716, 13083431, 13083573, 13083545, 13083736, 13083575, 13083776, 13083778, 13083757, 13083547, 13083530, 13083719, 13083780, 13083739, 13083549, 13083741, 13083742, 13083590, 13083593, 13083594, 13083816, 13083818, 13083820, 13083822, 13083824, 13083827, 13083828, 13083552, 13083760, 13083762, 13083764, 13083782, 13083784, 13083831, 13083787, 13083766, 13083835, 13083745, 13083877, 13083720, 13083489, 13083491, 13083274, 13083859, 13083897] into rvc-qpr1-releaseandroid-11.0.0_r29android-11.0.0_r27android-11.0.0_r26android11-qpr1-release
Change-Id: I3e1cd62ccc6e6c005e8f8ab34b0b388cc25b5d7b
-rw-r--r--basicmbr.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/basicmbr.cc b/basicmbr.cc
index 8ac9789..e9ac5c5 100644
--- a/basicmbr.cc
+++ b/basicmbr.cc
@@ -292,7 +292,8 @@ int BasicMBRData::ReadLogicalParts(uint64_t extendedStart, int partNum) {
if (EbrLocations[i] == offset) { // already read this one; infinite logical partition loop!
cerr << "Logical partition infinite loop detected! This is being corrected.\n";
allOK = -1;
- partNum -= 1;
+ if(partNum > 0) //don't go negative
+ partNum -= 1;
} // if
} // for
EbrLocations[partNum] = offset;