X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fcart.c;h=b35eb533233871e60ac451c0def626a4d6f72ba3;hb=3d5e32fe21b56d59a116195a66f300735af5a7ec;hp=d237fad9018f92a6ae13c2e702b113b76ae66331;hpb=7eaf128fac9de00394c664f59f40bebae8b122b2;p=picodrive.git diff --git a/pico/cart.c b/pico/cart.c index d237fad..b35eb53 100644 --- a/pico/cart.c +++ b/pico/cart.c @@ -50,7 +50,7 @@ typedef struct _cso_struct } cso_struct; -static int uncompress2(void *dest, int destLen, void *source, int sourceLen) +static int uncompress_buf(void *dest, int destLen, void *source, int sourceLen) { z_stream stream; int err; @@ -298,7 +298,7 @@ size_t pm_read(void *ptr, size_t bytes, pm_file *stream) } cso->block_in_buff = block; } - rret = uncompress2(tmp_dst, 2048, cso->in_buff, read_len); + rret = uncompress_buf(tmp_dst, 2048, cso->in_buff, read_len); if (rret != 0) { elprintf(EL_STATUS, "cso: uncompress failed @ %08x with %i", read_pos, rret); break; @@ -513,7 +513,7 @@ int PicoCartLoad(pm_file *f,unsigned char **prom,unsigned int *psize,int is_sms) bytes_read = pm_read(rom,size,f); // Load up the rom if (bytes_read <= 0) { elprintf(EL_STATUS, "read failed"); - free(rom); + plat_munmap(rom, rom_alloc_size); return 3; }