Skip to content

Commit

Permalink
Fixed|libgui: Recognizing TGA image data
Browse files Browse the repository at this point in the history
Zero-area images are invalid.
  • Loading branch information
skyjake committed Jan 22, 2020
1 parent e1e8d5b commit 6c9ff26
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doomsday/sdk/libgui/src/graphics/image.cpp
Expand Up @@ -239,6 +239,10 @@ static bool recognize(Block const &data)
{
Header header;
Reader(data) >> header;
if (header.size.x == 0 || header.size.y == 0)
{
return false;
}
if (header.imageType == Header::ColorMapped && header.colorMapType == Header::ColorMap256 &&
header.depth == 8)
{
Expand Down

0 comments on commit 6c9ff26

Please sign in to comment.