diff options
author | 2015-01-11 08:30:12 +0100 | |
---|---|---|
committer | 2015-01-11 08:30:12 +0100 | |
commit | d67caf18608ef5510521625b3c15951c415df944 (patch) | |
tree | 92ee0af06a282e1af6b33b2b5b67e06c31b8b45c /3rdparty/lzma/C/LzmaDec.c | |
parent | 05bb04cd297dac694eba41bc3c47d582f5f3e057 (diff) |
Applied changes same as on previous source (nw)
Diffstat (limited to '3rdparty/lzma/C/LzmaDec.c')
-rw-r--r-- | 3rdparty/lzma/C/LzmaDec.c | 21 |
1 files changed, 21 insertions, 0 deletions
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) |