Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Unsupported TGA bpp/alphabit combinations should error gracefully
Currently, only 24bpp without alphabits and 32bpp with 8 alphabits are really supported. All other combinations will be rejected with a warning.
- Loading branch information
Showing
6 changed files
with
30 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| /bug00084 | ||
| /bug00247 | ||
| /bug00247a | ||
| /tga_null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ LIST(APPEND TESTS_FILES | |
| tga_null | ||
| bug00084 | ||
| bug00247 | ||
| bug00247a | ||
| ) | ||
|
|
||
| ADD_GD_TESTS() | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,11 @@ | ||
| libgd_test_programs += \ | ||
| tga/bug00084 \ | ||
| tga/bug00247 \ | ||
| tag/bug00247a \ | ||
| tga/tga_null | ||
|
|
||
| EXTRA_DIST += \ | ||
| tga/CMakeLists.txt \ | ||
| tga/bug00084.tga \ | ||
| tga/bug00247.tga | ||
| tga/bug00247.tga \ | ||
| tga/bug00247a.tga |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /* | ||
| We test that a 8bpp TGA file will be gracefully rejected by | ||
| gdImageCreateFromTga(). | ||
| */ | ||
|
|
||
| #include <stdio.h> | ||
|
|
||
| #include "gd.h" | ||
| #include "gdtest.h" | ||
|
|
||
| int main(int argc, char **argv) | ||
| { | ||
| gdImagePtr im; | ||
| FILE *fp = gdTestFileOpen("tga/bug00247a.tga"); | ||
| im = gdImageCreateFromTga(fp); | ||
| gdTestAssert(im == NULL); | ||
| fclose(fp); | ||
| return gdNumFailures(); | ||
| } |
Binary file not shown.