summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-08-27 11:58:35 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-08-27 11:58:35 +0900
commit5b5ee4857adcd7cd5c9d2ebec68a505f5337f371 (patch)
treef1cbac856aa8571a1c65b6e1538dd7906302da5f /src/modules
parent7847c2dafe9d1cdfd3b922f44364bb6a558a4f31 (diff)
downloadefl-5b5ee4857adcd7cd5c9d2ebec68a505f5337f371.tar.gz
evas - tga loader - fix alpha handling for 16/15bpp images
tga provides 16bpp images as actually 15bpp. the upper bit (alpha mask bit) can be 0 or 1, but we don't check the descriptor byte to see if this bit is relevant or not. coverity pointed this out in CID 1039473 - logically dead code that should not have been dead except for this missing logic. well done coverity!
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/loaders/tga/evas_image_load_tga.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/modules/evas/loaders/tga/evas_image_load_tga.c b/src/modules/evas/loaders/tga/evas_image_load_tga.c
index bcdfb2be3a..74d2c620af 100644
--- a/src/modules/evas/loaders/tga/evas_image_load_tga.c
+++ b/src/modules/evas/loaders/tga/evas_image_load_tga.c
@@ -128,6 +128,7 @@ evas_image_load_file_head_tga(void *loader_data,
if (!((bpp == 32) || (bpp == 24) || (bpp == 16) || (bpp == 8)))
goto close_file;
if ((bpp == 32) && (header->descriptor & TGA_DESC_ABITS)) hasa = 1;
+ if ((bpp == 16) && (header->descriptor & TGA_DESC_ABITS)) hasa = 1;
// don't handle colormapped images
if ((header->colorMapType) != 0)
goto close_file;
@@ -228,6 +229,7 @@ evas_image_load_file_data_tga(void *loader_data,
if (!((bpp == 32) || (bpp == 24) || (bpp == 16) || (bpp == 8)))
goto close_file;
if ((bpp == 32) && (header->descriptor & TGA_DESC_ABITS)) hasa = 1;
+ if ((bpp == 16) && (header->descriptor & TGA_DESC_ABITS)) hasa = 1;
abits = header->descriptor & TGA_DESC_ABITS;
// don't handle colormapped images
if ((header->colorMapType) != 0)