Skip to content

Commit

Permalink
Fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
chpock committed Oct 16, 2024
1 parent fa2e707 commit b9f8a14
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions generic/pages.c
Original file line number Diff line number Diff line change
Expand Up @@ -3345,10 +3345,12 @@ skipEncryption: ; // empty statement
fsindexSizeCompressed - COOKFS_SUFFIX_BYTES;

// If we have page data, subtract the size of all pages.
int pgindexLength = Cookfs_PgIndexGetLength(p->pagesIndex);
if (pgindexLength > 0) {
p->dataInitialOffset -= Cookfs_PgIndexGetStartOffset(p->pagesIndex,
pgindexLength);
if (p->pagesIndex != NULL) {
int pgindexLength = Cookfs_PgIndexGetLength(p->pagesIndex);
if (pgindexLength > 0) {
p->dataInitialOffset -= Cookfs_PgIndexGetStartOffset(p->pagesIndex,
pgindexLength);
}
}

if (p->dataInitialOffset < 0) {
Expand Down

0 comments on commit b9f8a14

Please sign in to comment.