diff --git a/nufxlib-0/Compress.c b/nufxlib-0/Compress.c index 0105352..f93680d 100644 --- a/nufxlib-0/Compress.c +++ b/nufxlib-0/Compress.c @@ -347,7 +347,7 @@ Nu_CopyPresizedToArchive(NuArchive* pArchive, NuDataSource* pDataSource, pThread->thThreadCRC = 0; /* no CRC on pre-sized stuff */ pThread->thThreadEOF = srcLen; pThread->thCompThreadEOF = bufferLen; - pThread->actualThreadEOF = bufferLen; + pThread->actualThreadEOF = srcLen; /* nuThreadIdx and fileOffset should already be set */ /* diff --git a/nufxlib-0/Thread.c b/nufxlib-0/Thread.c index a6eadb4..381a21e 100644 --- a/nufxlib-0/Thread.c +++ b/nufxlib-0/Thread.c @@ -744,7 +744,7 @@ retry_name: } bail: - if (err != kNuErrNone) { + if (err != kNuErrNone && pProgressData != nil) { /* send a final progress message, indicating failure */ if (err == kNuErrSkipped) pProgressData->state = kNuProgressSkipped; @@ -825,6 +825,8 @@ Nu_ExtractThread(NuArchive* pArchive, NuThreadIdx threadIdx, return kNuErrUsage; if (threadIdx == 0 || pDataSink == nil) return kNuErrInvalidArg; + err = Nu_GetTOCIfNeeded(pArchive); + BailError(err); /* find the correct record and thread by index */ err = Nu_RecordSet_FindByThreadIdx(&pArchive->origRecordSet, threadIdx,