WerWolv / ImHex

🔍 A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.
https://imhex.werwolv.net
GNU General Public License v2.0
40.05k stars 1.76k forks source link

[Bug] Large files can cause updateFilter run until the program crashes. #1778

Open ookami125 opened 5 days ago

ookami125 commented 5 days ago

Operating System

Linux

What's the issue you encountered?

Program will crash when loading the png pattern with a large png. Digging around a little bit it seems like all the parsing works fine, the program seems to get hung up in (void hex::ui::PatternDrawer::updateFilter()) even though no filter is set. I don't really know a solution besides having a quick exit for when no filter is set.

How can the issue be reproduced?

Load a large png (~7MB / 3120x3920) and then import the png.hexpat pattern. The program will hang and eventually close without any errors.

ImHex Version

1.36.0.WIP

ImHex Build Type

Installation type

Built from source

Additional context?

https://upload.wikimedia.org/wikipedia/commons/6/6a/PNG_Test.png seems to repro the issue on my machine

WerWolv commented 5 days ago

Thanks for the report! Filtering should probably be done in a background thread like other things are as well. The PNG pattern most likely just produces so many patterns that it takes a while to apply the filter. I'll see what I can do.

ookami125 commented 4 days ago

Thanks, I just disabled mine for now since as before I'm not using it. Would be nice if I could in the future though. I also have another crash but it's much harder to reproduce, so I'm waiting till I have more details before filing a ticket.