mirror of
https://github.com/QuasarApp/LIEF.git
synced 2025-05-07 09:19:34 +00:00
Merge pull request #420 from kohnakagawa/fix/handle_empty_dialog
fix to parse the files that have empty dialogs and langs
This commit is contained in:
commit
565593dade
@ -1010,10 +1010,18 @@ std::vector<ResourceDialog> ResourcesManager::dialogs(void) const {
|
||||
for (size_t i = 0; i < nodes.size(); ++i) {
|
||||
|
||||
const ResourceDirectory* dialog = dynamic_cast<const ResourceDirectory*>(&nodes[i]);
|
||||
if (!dialog) {
|
||||
LOG(WARNING) << "Dialog is empty. Skipping";
|
||||
continue;
|
||||
}
|
||||
it_const_childs langs = dialog->childs();
|
||||
|
||||
for (size_t j = 0; j < langs.size(); ++j) {
|
||||
const ResourceData* data_node = dynamic_cast<const ResourceData*>(&langs[j]);
|
||||
if (!data_node) {
|
||||
LOG(WARNING) << "Dialog is empty. Skipping";
|
||||
continue;
|
||||
}
|
||||
const std::vector<uint8_t>& content = data_node->content();
|
||||
VectorStream stream{content};
|
||||
stream.setpos(0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user