forked from Green-Sky/tomato
update deps and dont try to load files >50mib as images
This commit is contained in:
parent
6df0417667
commit
4edab11616
2
external/solanaceae_message3
vendored
2
external/solanaceae_message3
vendored
@ -1 +1 @@
|
||||
Subproject commit d2d6cfbf5326de74cbac2dcd11be74df2cf79d2a
|
||||
Subproject commit 53d65a06855129135e5884f50d9983676290ac24
|
2
external/solanaceae_tox
vendored
2
external/solanaceae_tox
vendored
@ -1 +1 @@
|
||||
Subproject commit 70a234cdae751141f48b7a53a4e1cbedd84f31b2
|
||||
Subproject commit dd596bdad8d71654ff21dd3a032d6eb2dd7139a8
|
2
external/solanaceae_toxcore
vendored
2
external/solanaceae_toxcore
vendored
@ -1 +1 @@
|
||||
Subproject commit b49db892f6f0069985c763f7c8598b57fc9810dd
|
||||
Subproject commit dfa5a501ec4b4d929f473dabd51fa39bc0550266
|
@ -76,6 +76,8 @@ Screen* MainScreen::poll(bool& quit) {
|
||||
|
||||
quit = !tc.iterate();
|
||||
|
||||
tcm.iterate(time_delta);
|
||||
|
||||
pm.tick(time_delta);
|
||||
|
||||
mts.iterate();
|
||||
|
@ -25,6 +25,15 @@ void MediaMetaInfoLoader::handleMessage(const Message3Handle& m) {
|
||||
|
||||
std::ifstream file(fil.file_list.front(), std::ios::binary);
|
||||
if (file.is_open()) {
|
||||
// figure out size
|
||||
file.seekg(0, file.end);
|
||||
if (file.tellg() > 50*1024*1024) {
|
||||
// TODO: conf
|
||||
// dont try load files larger 50mb
|
||||
return;
|
||||
}
|
||||
file.seekg(0, file.beg);
|
||||
|
||||
std::vector<uint8_t> tmp_buffer;
|
||||
while (file.good()) {
|
||||
auto ch = file.get();
|
||||
@ -38,6 +47,7 @@ void MediaMetaInfoLoader::handleMessage(const Message3Handle& m) {
|
||||
bool could_load {false};
|
||||
// try all loaders after another
|
||||
for (auto& il : _image_loaders) {
|
||||
// TODO: impl callback based load
|
||||
auto res = il->loadInfoFromMemory(tmp_buffer.data(), tmp_buffer.size());
|
||||
if (res.height == 0 || res.width == 0) {
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user