RudolphRiedel / FT800-FT813

Multi-Platform C code Library for EVE graphics controllers from FTDI / Bridgetek (FT810, FT811, FT812, FT813, BT815, BT816, BT817, BT818)
MIT License
121 stars 56 forks source link

FT8_cmd_inflate() overflows the buffer #4

Closed DFL-git closed 6 years ago

DFL-git commented 6 years ago

Hi! Awesome work with EVE, thanks for sharing.

I'm having some issues with cmd_inflate() with big images (larger than 4k). Looking at the code, I realize there is no treatment to split the transfers, like the cmd_loadimage().

Surprisingly the same solution for the load_image doesn't work on inflate (or I'm doing something wrong). Maybe need something different.

Thanks!

RudolphRiedel commented 6 years ago

Hello,

I have to admit that I put that issue aside. I tried to fix it at least two times and for whatever reason it did not work. And then a cmd_inflate() that supports more than 4k seems to be a bit pointless since the compression for L8 is pretty good which means you can put quite some pixels into it for large icons. The compression for RGB565 is not nearly as good as .jpg which is even more true for "chaotic" content like fotos. With drawn color-icons .png might be the best choice with lossless and high compression, although it is rather slow.

Whatever, I tried to fix it again, tested it with a picture that FTDIs image-convert tool compresses to just under 8k - and this time it just worked.

I just uploaded a new FT8_commands.c. As part of the fix FT8_cmd_inflate() no longer needs a trailing FT8_cmd_execute().

Have fun, Rudolph