(RPNG) Add data_restore_buf_size

This commit is contained in:
twinaphex 2015-03-13 23:54:17 +01:00
parent 978628a878
commit 752f5dc42b
2 changed files with 5 additions and 1 deletions

View File

@ -299,7 +299,8 @@ static int png_reverse_filter_init(const struct png_ihdr *ihdr,
if (pngp->stream.total_out < pass_size)
return -1;
pngp->restore_buf_size = 0;
pngp->restore_buf_size = 0;
pngp->data_restore_buf_size = 0;
pngp->prev_scanline = (uint8_t*)calloc(1, pngp->pitch);
pngp->decoded_scanline = (uint8_t*)calloc(1, pngp->pitch);
@ -443,11 +444,13 @@ static int png_reverse_filter_regular_loop(uint32_t **data_, const struct png_ih
break;
case PNG_PROCESS_NEXT:
data += ihdr->width;
pngp->data_restore_buf_size += ihdr->width;
}
}while(ret == PNG_PROCESS_NEXT);
pngp->inflate_buf -= pngp->restore_buf_size;
pngp->data_restore_buf_size = 0;
return ret;
}

View File

@ -73,6 +73,7 @@ struct rpng_process_t
uint8_t *inflate_buf;
size_t restore_buf_size;
size_t adam7_restore_buf_size;
size_t data_restore_buf_size;
size_t inflate_buf_size;
unsigned bpp;
unsigned pitch;