Description
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.