diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2014-08-27 11:58:35 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2014-08-27 11:58:35 +0900 |
commit | 5b5ee4857adcd7cd5c9d2ebec68a505f5337f371 (patch) | |
tree | f1cbac856aa8571a1c65b6e1538dd7906302da5f /src/modules | |
parent | 7847c2dafe9d1cdfd3b922f44364bb6a558a4f31 (diff) | |
download | efl-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.c | 2 |
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) |