void Unpack::Init(byte *Window) { if (Window==NULL) { Unpack::Window=new byte[MAXWINSIZE]; // Clean the window to generate the same output when unpacking corrupt // RAR files, which may access to unused areas of sliding dictionary. memset(Unpack::Window,0,MAXWINSIZE); #ifndef ALLOW_EXCEPTIONS if (Unpack::Window==NULL) ErrHandler.MemoryError(); #endif } else { Unpack::Window=Window; ExternalWindow=true; } UnpInitData(false); #ifndef SFX_MODULE // RAR 1.5 decompression initialization OldUnpInitData(false); InitHuff(); #endif }
void Unpack::Init(byte *Window) { if (Window==NULL) { Unpack::Window = (byte*) rarmalloc( MAXWINSIZE ); if (Unpack::Window==NULL) ErrHandler.MemoryError(); } else { Unpack::Window=Window; ExternalWindow=true; } UnpInitData(false); BitInput::handle_mem_error( ErrHandler ); Inp.handle_mem_error( ErrHandler ); // Only check BitInput, as VM's memory isn't allocated yet VM.BitInput::handle_mem_error( ErrHandler ); #ifndef SFX_MODULE // RAR 1.5 decompression initialization OldUnpInitData(false); InitHuff(); #endif }
void Unpack::Init(byte *Window) { if (Window==NULL) { Unpack::Window=new byte[MAXWINSIZE]; #ifndef ALLOW_EXCEPTIONS if (Unpack::Window==NULL) ErrHandler.MemoryError(); #endif } else { Unpack::Window=Window; ExternalWindow=true; } UnpInitData(false); #ifndef SFX_MODULE // RAR 1.5 decompression initialization OldUnpInitData(false); InitHuff(); #endif }