2015-01-18 20:40:53 -08:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "gd.h"
|
|
|
|
#include "gdtest.h"
|
|
|
|
|
2016-07-12 17:20:38 -07:00
|
|
|
int main()
|
2015-01-18 20:40:53 -08:00
|
|
|
{
|
|
|
|
gdImagePtr im;
|
2016-06-03 17:31:02 -07:00
|
|
|
FILE *fp = gdTestFileOpen("tga/bug00084.tga");
|
Fix tests based on coverity reports (#819)
* Partial #818, unused arg
* Partial #818, init var
* partail #818, fix va_args usage
* partail #818, handle f* calls and avoid possible call to malloc with negative values
* partail #818, prevent double free
* partail #818, resource leak if test fail
* partail #818, null deref fix
* partail #818, avoid double free on fp failure
* Partial #818, fix error msg
* Partial #818, leak on error
* Partial #818, null deref
* Partial #818, avoid possible negative index on failure
* partial #818, does not free if we return if requested new size overflow
* partial #818, avoid double free, free where the alloc happened
2022-02-01 00:09:01 -08:00
|
|
|
if (gdTestAssert(fp == NULL)) {
|
|
|
|
return 1;
|
|
|
|
}
|
2015-01-18 20:40:53 -08:00
|
|
|
im = gdImageCreateFromTga(fp);
|
Fix tests based on coverity reports (#819)
* Partial #818, unused arg
* Partial #818, init var
* partail #818, fix va_args usage
* partail #818, handle f* calls and avoid possible call to malloc with negative values
* partail #818, prevent double free
* partail #818, resource leak if test fail
* partail #818, null deref fix
* partail #818, avoid double free on fp failure
* Partial #818, fix error msg
* Partial #818, leak on error
* Partial #818, null deref
* Partial #818, avoid possible negative index on failure
* partial #818, does not free if we return if requested new size overflow
* partial #818, avoid double free, free where the alloc happened
2022-02-01 00:09:01 -08:00
|
|
|
fclose(fp);
|
|
|
|
if (gdTestAssert(im != NULL)) {
|
|
|
|
gdImageDestroy(im);
|
|
|
|
}
|
2015-01-18 20:40:53 -08:00
|
|
|
return 0;
|
|
|
|
}
|