mirror of
https://github.com/ipxe/ipxe
synced 2026-01-07 04:31:39 +03:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user