Fix loading invalid FLIC or with huge image sizes

This commit is contained in:
David Capello 2020-03-21 20:54:41 -03:00
parent 72b5f0e701
commit b95b01aa9a
2 changed files with 9 additions and 4 deletions

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2018-2019 Igara Studio S.A.
// Copyright (C) 2018-2020 Igara Studio S.A.
// Copyright (C) 2001-2018 David Capello
//
// This program is distributed under the terms of
@ -76,8 +76,13 @@ bool FliFormat::onLoad(FileOp* fop)
}
// Size by frame
int w = header.width;
int h = header.height;
const int w = header.width;
const int h = header.height;
ASSERT(w > 0 && h > 0); // The decoder cannot return invalid widht/height values
if (w > 10000 || h > 10000) {
fop->setError("Image size too big: %dx%d not suported\n", w, h);
return false;
}
// Create a temporal bitmap
ImageRef bmp(Image::create(IMAGE_INDEXED, w, h));

@ -1 +1 @@
Subproject commit 237225c9d8338553d86d43eec38a904f0d72a452
Subproject commit bfa19443852dbe4d47aee9760fb5108ff71db34d