image-png
image-png copied to clipboard
Failed to load image: Insufficient memory
I found a PNG image that fails to load with image-png
through image-rs
with the error message:
Failed to load image: Insufficient memory
That's a pretty large iTXT chunk of 1314946 bytes in there. The problem: the decoder is allocating a vector with chunk contents and it's not using the limit configured for the pixel matrix, but a separate one .
Here's the same issue with more info https://github.com/image-rs/image/issues/1788
its not just text chunks that can be so large. This image for example has a 2mb caBX (jpeg metadata in a png file) chunk before the image data starts. I will try to fix this in a PR but i'm not yet sure how to access the limits in the StreamingDecoder, any helping pointers would be very appreciated.
@fintelia all works now https://github.com/danyspin97/wpaperd/issues/21#issuecomment-1994461074. Thanks for fixing!