mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-09-19 02:27:55 +08:00
Fix a bug in reading usage maps
This commit is contained in:
@@ -269,16 +269,20 @@ int mdb_read_next_dpg(MdbTableDef *table)
|
||||
MdbCatalogEntry *entry = table->entry;
|
||||
MdbHandle *mdb = entry->mdb;
|
||||
int next_pg;
|
||||
int map_type;
|
||||
|
||||
#ifndef SLOW_READ
|
||||
next_pg = mdb_map_find_next(mdb, table->usage_map,
|
||||
table->map_sz, table->cur_phys_pg);
|
||||
|
||||
if (next_pg && mdb_read_pg(mdb, next_pg)) {
|
||||
table->cur_phys_pg = next_pg;
|
||||
return table->cur_phys_pg;
|
||||
if (next_pg >= 0) {
|
||||
if (mdb_read_pg(mdb, next_pg)) {
|
||||
table->cur_phys_pg = next_pg;
|
||||
return table->cur_phys_pg;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
fprintf(stderr, "Warning: defaulting to brute force read\n");
|
||||
#endif
|
||||
/* can't do a fast read, go back to the old way */
|
||||
do {
|
||||
|
Reference in New Issue
Block a user