diff options
Diffstat (limited to 'src/engine/package.cpp')
| -rw-r--r-- | src/engine/package.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/engine/package.cpp b/src/engine/package.cpp index ecf1488b..dd4e498a 100644 --- a/src/engine/package.cpp +++ b/src/engine/package.cpp | |||
| @@ -349,7 +349,7 @@ extern "C" void PackageUninitialize( | |||
| 349 | MemFree(pPackage->rgDependencyProviders); | 349 | MemFree(pPackage->rgDependencyProviders); |
| 350 | } | 350 | } |
| 351 | 351 | ||
| 352 | ReleaseMem(pPackage->payloads.rgpPayloads); | 352 | ReleaseMem(pPackage->payloads.rgItems); |
| 353 | 353 | ||
| 354 | switch (pPackage->type) | 354 | switch (pPackage->type) |
| 355 | { | 355 | { |
| @@ -567,14 +567,16 @@ static HRESULT ParsePayloadRefsFromXml( | |||
| 567 | } | 567 | } |
| 568 | 568 | ||
| 569 | // allocate memory for payload pointers | 569 | // allocate memory for payload pointers |
| 570 | pPackage->payloads.rgpPayloads = (BURN_PAYLOAD**)MemAlloc(sizeof(BURN_PAYLOAD*) * cNodes, TRUE); | 570 | pPackage->payloads.rgItems = (BURN_PAYLOAD_GROUP_ITEM*)MemAlloc(sizeof(BURN_PAYLOAD_GROUP_ITEM) * cNodes, TRUE); |
| 571 | ExitOnNull(pPackage->payloads.rgpPayloads, hr, E_OUTOFMEMORY, "Failed to allocate memory for package payloads."); | 571 | ExitOnNull(pPackage->payloads.rgItems, hr, E_OUTOFMEMORY, "Failed to allocate memory for package payloads."); |
| 572 | 572 | ||
| 573 | pPackage->payloads.cPayloads = cNodes; | 573 | pPackage->payloads.cItems = cNodes; |
| 574 | 574 | ||
| 575 | // parse package elements | 575 | // parse package elements |
| 576 | for (DWORD i = 0; i < cNodes; ++i) | 576 | for (DWORD i = 0; i < cNodes; ++i) |
| 577 | { | 577 | { |
| 578 | BURN_PAYLOAD_GROUP_ITEM* pPackagePayload = pPackage->payloads.rgItems + i; | ||
| 579 | |||
| 578 | hr = XmlNextElement(pixnNodes, &pixnNode, NULL); | 580 | hr = XmlNextElement(pixnNodes, &pixnNode, NULL); |
| 579 | ExitOnFailure(hr, "Failed to get next node."); | 581 | ExitOnFailure(hr, "Failed to get next node."); |
| 580 | 582 | ||
| @@ -583,10 +585,10 @@ static HRESULT ParsePayloadRefsFromXml( | |||
| 583 | ExitOnFailure(hr, "Failed to get Id attribute."); | 585 | ExitOnFailure(hr, "Failed to get Id attribute."); |
| 584 | 586 | ||
| 585 | // find payload | 587 | // find payload |
| 586 | hr = PayloadFindById(pPayloads, sczId, &pPackage->payloads.rgpPayloads[i]); | 588 | hr = PayloadFindById(pPayloads, sczId, &pPackagePayload->pPayload); |
| 587 | ExitOnFailure(hr, "Failed to find payload."); | 589 | ExitOnFailure(hr, "Failed to find payload."); |
| 588 | 590 | ||
| 589 | pPackage->payloads.qwTotalSize += pPackage->payloads.rgpPayloads[i]->qwFileSize; | 591 | pPackage->payloads.qwTotalSize += pPackagePayload->pPayload->qwFileSize; |
| 590 | 592 | ||
| 591 | // prepare next iteration | 593 | // prepare next iteration |
| 592 | ReleaseNullObject(pixnNode); | 594 | ReleaseNullObject(pixnNode); |
