[deflate] Remove userptr_t from decompression code

Simplify the deflate, zlib, and gzip decompression code by assuming
that all content is fully accessible via pointer dereferences.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-04-22 12:13:22 +01:00
parent b89a34b07f
commit c059b34170
9 changed files with 153 additions and 154 deletions

View File

@@ -336,13 +336,12 @@ static int png_palette ( struct image *image, struct png_context *png,
*/
static int png_image_data ( struct image *image, struct png_context *png,
size_t len ) {
struct deflate_chunk in;
int rc;
/* Deflate this chunk */
deflate_chunk_init ( &in, image->data, png->offset,
( png->offset + len ) );
if ( ( rc = deflate_inflate ( &png->deflate, &in, &png->raw ) ) != 0 ) {
if ( ( rc = deflate_inflate ( &png->deflate,
( image->data + png->offset ),
len, &png->raw ) ) != 0 ) {
DBGC ( image, "PNG %s could not decompress: %s\n",
image->name, strerror ( rc ) );
return rc;