X-Git-Url: https://sfsrealm.hopto.org/projects/gitweb.cgi?p=SFmpqapi.git;a=blobdiff_plain;f=SFmpqapi.cpp;fp=SFmpqapi.cpp;h=faf2701904a1232e928bb361d115def454eb3811;hp=db69b6006f09d5ab28262ea3cb33f292bed0de5a;hb=af6cb211f3c877df7f551115123b1e0bb5ed6206;hpb=41207b3631795f5b382518a8b575ef13c42058a1 diff --git a/SFmpqapi.cpp b/SFmpqapi.cpp index db69b60..faf2701 100644 --- a/SFmpqapi.cpp +++ b/SFmpqapi.cpp @@ -2187,6 +2187,7 @@ BOOL SFMPQAPI WINAPI MpqAddFileFromBufferEx(MPQHANDLE hMPQ, LPVOID lpBuffer, DWO if (i==TotalBlocks-1 && (ucfsz % blockSize)!=0) blockSize=ucfsz % blockSize; DWORD outLength=blockSize; BYTE *compdata = compbuffer; + char *oldoutbuffer = outbuffer; if (dwFlags & MAFA_COMPRESS) { memcpy(compdata,(char *)buffer+CurPos,blockSize); @@ -2233,6 +2234,7 @@ BOOL SFMPQAPI WINAPI MpqAddFileFromBufferEx(MPQHANDLE hMPQ, LPVOID lpBuffer, DWO memcpy((char *)newbuffer+LastOffset,outbuffer,outLength); LastOffset+=outLength; } + outbuffer = oldoutbuffer; CurPos += blockSize; } fsz = LastOffset;