From d67caf18608ef5510521625b3c15951c415df944 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 11 Jan 2015 08:30:12 +0100 Subject: Applied changes same as on previous source (nw) --- 3rdparty/lzma/C/LzmaDec.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to '3rdparty/lzma/C/LzmaDec.c') diff --git a/3rdparty/lzma/C/LzmaDec.c b/3rdparty/lzma/C/LzmaDec.c index 8c1a1486df1..f7f79bb063d 100644 --- a/3rdparty/lzma/C/LzmaDec.c +++ b/3rdparty/lzma/C/LzmaDec.c @@ -967,6 +967,27 @@ SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAll return SZ_OK; } +// why isn't there an interface to pass in the properties directly???? +SRes LzmaDec_Allocate_MAME(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc) +{ + SizeT dicBufSize; + RINOK(LzmaDec_AllocateProbs2(p, propNew, alloc)); + dicBufSize = propNew->dicSize; + if (p->dic == 0 || dicBufSize != p->dicBufSize) + { + LzmaDec_FreeDict(p, alloc); + p->dic = (Byte *)alloc->Alloc(alloc, dicBufSize); + if (p->dic == 0) + { + LzmaDec_FreeProbs(p, alloc); + return SZ_ERROR_MEM; + } + } + p->dicBufSize = dicBufSize; + p->prop = *propNew; + return SZ_OK; +} + SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAlloc *alloc) -- cgit v1.2.3-70-g09d2