It will be crashing because you pass it invalid data. If you want to work on a corrupt image, it's best to do all the decoding yourself and then fill QImage with proper data manually.
First create an emtpy QImage object with a defined size and format (QImage::Format_Indexed8 will probably be best for a gif image).
Then fill the color table based on the data from the corrupt file.
Then fill pixel data either using QImage::setPixel or with QImage::bits() if you have the data in a proper format. The data needs to be formatted linearly and it should contain indexes of the color table. You can't just copy the data straight into the pixel buffer of QImage because GIF stores it compressed, so you need to decompress it first manually.






Reply With Quote

Bookmarks