mirror of
https://github.com/crskycode/GARbro.git
synced 2025-01-12 04:49:32 +08:00
(TgaFormat.ReadMetaData): additional sanity check for color-mapped images.
This commit is contained in:
parent
8f6d2963bb
commit
1c031ad24b
@ -142,15 +142,18 @@ namespace GameRes
|
|||||||
{
|
{
|
||||||
default: return null;
|
default: return null;
|
||||||
case 1: // Uncompressed, color-mapped images.
|
case 1: // Uncompressed, color-mapped images.
|
||||||
case 2: // Uncompressed, RGB images.
|
|
||||||
case 3: // Uncompressed, black and white images.
|
|
||||||
case 9: // Runlength encoded color-mapped images.
|
case 9: // Runlength encoded color-mapped images.
|
||||||
case 10: // Runlength encoded RGB images.
|
|
||||||
case 11: // Compressed, black and white images.
|
|
||||||
case 32: // Compressed color-mapped data, using Huffman, Delta, and
|
case 32: // Compressed color-mapped data, using Huffman, Delta, and
|
||||||
// runlength encoding.
|
// runlength encoding.
|
||||||
case 33: // Compressed color-mapped data, using Huffman, Delta, and
|
case 33: // Compressed color-mapped data, using Huffman, Delta, and
|
||||||
// runlength encoding. 4-pass quadtree-type process.
|
// runlength encoding. 4-pass quadtree-type process.
|
||||||
|
if (colormap_depth != 24 && colormap_depth != 32)
|
||||||
|
return null;
|
||||||
|
break;
|
||||||
|
case 2: // Uncompressed, RGB images.
|
||||||
|
case 3: // Uncompressed, black and white images.
|
||||||
|
case 10: // Runlength encoded RGB images.
|
||||||
|
case 11: // Compressed, black and white images.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return new TgaMetaData {
|
return new TgaMetaData {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user