Skip to content

Commit

Permalink
add tool hpatch_deccompress_mem
Browse files Browse the repository at this point in the history
  • Loading branch information
sisong committed Aug 24, 2019
1 parent 3517780 commit 9dd5791
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libHDiffPatch/HPatch/patch_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,16 @@ typedef int hpatch_BOOL;
const unsigned char* code,const unsigned char* code_end,
unsigned char* out_data,unsigned char* out_data_end){
hpatch_decompressHandle dec=0;
hpatch_BOOL result,colose_rt;
hpatch_TStreamInput codeStream;
mem_as_hStreamInput(&codeStream,code,code_end);
dec=decompressPlugin->open(decompressPlugin,(out_data_end-out_data),
&codeStream,0,codeStream.streamSize);
if (dec==0) return hpatch_FALSE;
if (!decompressPlugin->decompress_part(dec,out_data,out_data_end))
return hpatch_FALSE;
return decompressPlugin->close(decompressPlugin,dec);
result=decompressPlugin->decompress_part(dec,out_data,out_data_end);
colose_rt=decompressPlugin->close(decompressPlugin,dec);
assert(colose_rt);
return result;
}


Expand Down

0 comments on commit 9dd5791

Please sign in to comment.