mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-30 13:20:28 +00:00
Fix loading invalid FLIC or with huge image sizes
This commit is contained in:
parent
72b5f0e701
commit
b95b01aa9a
@ -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));
|
||||
|
2
src/flic
2
src/flic
@ -1 +1 @@
|
||||
Subproject commit 237225c9d8338553d86d43eec38a904f0d72a452
|
||||
Subproject commit bfa19443852dbe4d47aee9760fb5108ff71db34d
|
Loading…
x
Reference in New Issue
Block a user