Skip to content

read_until_image_data doesn't seem to read until an IDAT #559

Open
@PatD123

Description

@PatD123

I basically copied all the bytes of a png into another file (.pnle which is just smth i made up for a temp file). So technically up until the first IDAT chunk, all the metadata before should 100% be right.

I open the .pnle using png::Decoder to get a decoder object, then i call decoder.read_info(), which according to the spec and the src code, should read until the first IDAT. However, i truncate my .pnle a little bit towards the end, but all the metadata before the first IDAT is untouched. When the read_info func is called, it errors out giving me a MissingImageData inner error. Only, when i have the full entire png in the pnle does the read_info func complete.

In the Decoder src, read_info() calls read_until_image_data() and everytime it crashes saying that it's reached Decoded::ImageEnd already, which is only returned in stream.rs if it's found IEND.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions