mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Just a safety check in thin3d texture loading
This commit is contained in:
parent
5827b583d3
commit
efde6e44db
1 changed files with 5 additions and 0 deletions
|
@ -207,6 +207,11 @@ bool Thin3DTexture::LoadFromFileData(const uint8_t *data, size_t dataSize, T3DIm
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (num_levels < 0 || num_levels >= 16) {
|
||||||
|
ELOG("Invalid num_levels: %d. Falling back to one. Image: %dx%d", num_levels, width, height);
|
||||||
|
num_levels = 1;
|
||||||
|
}
|
||||||
|
|
||||||
Create(LINEAR2D, fmt, width[0], height[0], 1, num_levels);
|
Create(LINEAR2D, fmt, width[0], height[0], 1, num_levels);
|
||||||
for (int i = 0; i < num_levels; i++) {
|
for (int i = 0; i < num_levels; i++) {
|
||||||
if (image[i]) {
|
if (image[i]) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue